left-scroll action to the 'h' key (for Vim fans) KeyInfo key = new KeyInfo(KeyEvent.VK_H, 0); mapPaneKeyHandler.setBinding(key, MapPaneKeyHandler.Action.SCROLL_LEFT); Multiple bindings can be set with the {@linkplain #setBindings(Map)} or {@linkplain #setAllBindings(Map)} methods:
Map<KeyInfo, MapPaneKeyHandler.Action> bindings = new HashMap<KeyInfo, MapPaneKeyHandler.Action>(); bindings.put(new KeyInfo(KeyEvent.VK_H, 0), MapPaneKeyHandler.Action.SCROLL_LEFT); bindings.put(new KeyInfo(KeyEvent.VK_L, 0), MapPaneKeyHandler.Action.SCROLL_RIGHT); bindings.put(new KeyInfo(KeyEvent.VK_K, 0), MapPaneKeyHandler.Action.SCROLL_UP); bindings.put(new KeyInfo(KeyEvent.VK_J, 0), MapPaneKeyHandler.Action.SCROLL_DOWN); mapPaneKeyHandler.setBindings( bindings );
@see KeyInfo
@see AbstractMapPane#setKeyHandler(java.awt.event.KeyListener)
@author Michael Bedward
@since 8.0
@source $URL$
@version $Id$