From 72d88a5298f6de994382aa57cac3d06551480710 Mon Sep 17 00:00:00 2001 From: bokidori <176586502+bokidori@users.noreply.github.com> Date: Sun, 28 Jul 2024 21:29:50 +0200 Subject: [PATCH] Map Fn+Cursor_move to home/end (#728) Fn modifier switches cursor_left to home key, cursor_right to end key --- srcs/juloo.keyboard2/KeyModifier.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/srcs/juloo.keyboard2/KeyModifier.java b/srcs/juloo.keyboard2/KeyModifier.java index 0ea80ab..5763e99 100644 --- a/srcs/juloo.keyboard2/KeyModifier.java +++ b/srcs/juloo.keyboard2/KeyModifier.java @@ -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) {