From f64a0be6fa90958ceacd01d91ef4fcd193c815bc Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Tue, 31 Dec 2024 11:49:51 +0100 Subject: [PATCH] Fn: redo and pasteAsPlainText as undo and paste Allows typing redo and pasteAsPlainText easily with Fn or the round-trip gesture without adding them to the keyboard. --- 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 4de9e68..a273d70 100644 --- a/srcs/juloo.keyboard2/KeyModifier.java +++ b/srcs/juloo.keyboard2/KeyModifier.java @@ -212,6 +212,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 Editing: name = apply_fn_editing(k.getEditing()); break; } return (name == null) ? k : KeyValue.getKeyByName(name); } @@ -257,6 +258,16 @@ public final class KeyModifier } } + private static String apply_fn_editing(KeyValue.Editing p) + { + switch (p) + { + case UNDO: return "redo"; + case PASTE: return "pasteAsPlainText"; + default: return null; + } + } + private static KeyValue apply_ctrl(KeyValue k) { if (_modmap != null)