mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2024-11-21 23:03:11 +01:00
Map Fn+Cursor_move to home/end (#728)
Fn modifier switches cursor_left to home key, cursor_right to end key
This commit is contained in:
parent
bd50964651
commit
72d88a5298
@ -208,6 +208,7 @@ public final class KeyModifier
|
||||
case Keyevent: name = apply_fn_keyevent(k.getKeyevent()); break;
|
||||
case Event: name = apply_fn_event(k.getEvent()); break;
|
||||
case Placeholder: name = apply_fn_placeholder(k.getPlaceholder()); break;
|
||||
case Cursor_move: name = apply_fn_cursormove(k.getCursorMove()); break;
|
||||
}
|
||||
return (name == null) ? k : KeyValue.getKeyByName(name);
|
||||
}
|
||||
@ -253,6 +254,16 @@ public final class KeyModifier
|
||||
}
|
||||
}
|
||||
|
||||
private static String apply_fn_cursormove(short cur)
|
||||
{
|
||||
switch (cur)
|
||||
{
|
||||
case -1 : return "home"; // cursor_left
|
||||
case 1 : return "end"; // cursor_right
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** Return the name of modified key, or [null]. */
|
||||
private static String apply_fn_char(char c)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user