Skip to content

Commit

Permalink
Map Fn+Cursor_move to home/end (#728)
Browse files Browse the repository at this point in the history
Fn modifier switches cursor_left to home key, cursor_right to end key
  • Loading branch information
bokidori authored Jul 28, 2024
1 parent bd50964 commit 72d88a5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions srcs/juloo.keyboard2/KeyModifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ private static KeyValue apply_fn(KeyValue k)
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);
}
Expand Down Expand Up @@ -253,6 +254,16 @@ private static String apply_fn_placeholder(KeyValue.Placeholder p)
}
}

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)
{
Expand Down

0 comments on commit 72d88a5

Please sign in to comment.