From 568b5a99f6216578b5d7cf594aafe407366daced Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Tue, 31 Dec 2024 10:42:23 +0100 Subject: Add preferred position for undo/cut/copy/paste These keys are placed on the downward direction on the z/x/c/v keys when they are enabled in the settings. --- .../juloo.keyboard2/prefs/ExtraKeysPreference.java | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/srcs/juloo.keyboard2/prefs/ExtraKeysPreference.java b/srcs/juloo.keyboard2/prefs/ExtraKeysPreference.java index 0d0b3dc..08260aa 100644 --- a/srcs/juloo.keyboard2/prefs/ExtraKeysPreference.java +++ b/srcs/juloo.keyboard2/prefs/ExtraKeysPreference.java @@ -228,6 +228,40 @@ public class ExtraKeysPreference extends PreferenceCategory { switch (key_name) { + case "cut": + return new KeyboardData.PreferredPos(KeyValue.getKeyByName("x"), + new KeyboardData.KeyPos[]{ + new KeyboardData.KeyPos(2, 2, 8), + new KeyboardData.KeyPos(2, -1, 8), + new KeyboardData.KeyPos(-1, -1, 8), + }); + case "copy": + return new KeyboardData.PreferredPos(KeyValue.getKeyByName("c"), + new KeyboardData.KeyPos[]{ + new KeyboardData.KeyPos(2, 3, 8), + new KeyboardData.KeyPos(2, -1, 8), + new KeyboardData.KeyPos(-1, -1, 8), + }); + case "paste": + return new KeyboardData.PreferredPos(KeyValue.getKeyByName("v"), + new KeyboardData.KeyPos[]{ + new KeyboardData.KeyPos(2, 4, 8), + new KeyboardData.KeyPos(2, -1, 8), + new KeyboardData.KeyPos(-1, -1, 8), + }); + case "undo": + return new KeyboardData.PreferredPos(KeyValue.getKeyByName("z"), + new KeyboardData.KeyPos[]{ + new KeyboardData.KeyPos(2, 1, 8), + new KeyboardData.KeyPos(2, -1, 8), + new KeyboardData.KeyPos(-1, -1, 8), + }); + case "redo": + return new KeyboardData.PreferredPos(KeyValue.getKeyByName("y"), + new KeyboardData.KeyPos[]{ + new KeyboardData.KeyPos(0, -1, 8), + new KeyboardData.KeyPos(-1, -1, 8), + }); case "f11_placeholder": return new KeyboardData.PreferredPos(KeyValue.getKeyByName("9"), new KeyboardData.KeyPos[]{ -- cgit v1.2.3