java - Use default KeyMap of native OS -


While using the non-default system and feeling, we will have different keymaps.

For example, I am using Mac OS X and use and feel the subsets (see and feel non-default system). Mac OS X should be "Meta + A", but to use subStance, we need to type "ctrl + a" (and many more such as "next word", "previous word", "end line," start line "etc." ), So we did not feel like Mac OS X using the non-default system and feel (the look and feel of the material) was not felt.

/ Div>>

Nearly work

A less elegant solution, you can apply a key pressed method to override the default "ctrl + a" behavior Attempt to add the listener (Please note that adding the following sample "ctrl + a" not only adds support for "meta + a":

  @ override Public Zero Key Pressed (Last keyEvent e) {// d Get the default Toolkit shortcut mask ("Meta" for OSX) .inf keymask = Toolkit.getDefaultToolkit (). GetMenuShortcutKeyMask (); // Check the modifier against the keyEvent.META_MASK so you al ... if (E.F. .m.m.defier () == Keymask & amp; amp; E.getKeyCode () == KeyEvent.VK_A) {// Select everything (member of child text component class believes). This.selectAll (); // We handle this keystroke, 'A' will be ignored by the built-in text component e.consume ();}}  

Using a better alternative input map Will (see comments by Uders below).

>) Is a combination of presence see , as well as "system behavior", i.e. feel if you move around the material source, then override the ships with the swing It seems like within BasicLookAndFeel it is that the offensive behavior has been set in initComponentDefaults. You should be able to get UEDFLAS from LAF by calling GetDefaults ().

Here are the problems:

  • The "System Behavior" that you want to change, you want to leave the untouched with the appearance settings.
  • I can not find any easy way to take these lapses in substance at the LF level ... Anyone else with this?