Menu

#73 KP_ARROW keys same as non-KP_ keys

v5.2
closed-fixed
None
5
2014-03-24
2006-10-14
No

Please add a user option that makes keypad arrow keys
respond as if they were part of the edit group arrow
keys. Example: KP_RIGHT -> RIGHT, etc. This would
allow shortcut definitions defined under jEdit/Windows
to be ported directly to jEdit/LINUX.

I'm not sure if this is a bug report or a feature
request because all keypad keys except arrows already
behave this way, i.e. ENTER, PGUP, PGDN, HOME, END,
INSERT, DELETE, etc.

Discussion

  • Alan Ezust

    Alan Ezust - 2014-03-24
    • status: open --> closed-fixed
    • assigned_to: Alan Ezust
    • Group: --> v5.2
     
  • Alan Ezust

    Alan Ezust - 2014-03-24

    I added the following code to trunk's Startup/tartup.bsh but you can add it to your own and use your favorite version of jEdit.

    As of jEdit 5.2, the keypad and the regular arrowkeys should behave the same way on all platforms.

    /*{{{ Keypad arrowkeys vs regular arrowkeys 
        Linux distinguishes between keypad arrowkeys and regular arrows, unlike Windows.
        The translations below force keypad arrowkeys to behave the same way as regular arrowkeys
        on all platforms.
    */
    
    String[] modifierList = new String[] {"A", "C", "S", "CA", "AS", "CS", null};
    
    for (String mod: modifierList) {
        linp = new KeyEventTranslator.Key(mod, KeyEvent.VK_KP_LEFT, (char)0);
        crossp = new KeyEventTranslator.Key(mod, KeyEvent.VK_LEFT, (char)0); 
        KeyEventTranslator.addTranslation(linp, crossp);
        linp = new KeyEventTranslator.Key(mod, KeyEvent.VK_KP_RIGHT, (char)0);
        crossp = new KeyEventTranslator.Key(mod, KeyEvent.VK_RIGHT, (char)0); 
        KeyEventTranslator.addTranslation(linp, crossp);
        linp = new KeyEventTranslator.Key(mod, KeyEvent.VK_KP_UP, (char)0);
        crossp = new KeyEventTranslator.Key(mod, KeyEvent.VK_UP, (char)0); 
        KeyEventTranslator.addTranslation(linp, crossp);
        linp = new KeyEventTranslator.Key(mod, KeyEvent.VK_KP_DOWN, (char)0);
        crossp = new KeyEventTranslator.Key(mod, KeyEvent.VK_DOWN, (char)0); 
        KeyEventTranslator.addTranslation(linp, crossp);
    }
    
     

Log in to post a comment.