/** * Installs keyboard action (space / enter keys) on the specified command * button. * * @param button * Command button. */ public void installKeyboardActions(AbstractCommandButton button) { ActionMap map = new ActionMap(); map.put(PressAction.PRESS, new PressAction(button)); map.put(ReleaseAction.RELEASE, new ReleaseAction(button)); SwingUtilities.replaceUIActionMap(button, map); InputMap km = LookAndFeel.makeInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released", "ENTER", "pressed", "released ENTER", "released" }); SwingUtilities.replaceUIInputMap(button, JComponent.WHEN_FOCUSED, km); }
defaults.put("HexViewer.focusInputMap", LookAndFeel.makeInputMap(new Object[] { "DOWN", "cursorDown", "PAGE_DOWN", "cursorPageDown", })); } else { defaults.put("HexViewer.focusInputMap", LookAndFeel.makeInputMap(new Object[] { "DOWN", "cursorDown", "PAGE_DOWN", "cursorPageDown",