From 773147ab9c19d49a7958e07c50455204e49a2ecc Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 9 Jun 2024 13:55:27 +0200 Subject: Automatic placement of f11/f12 placeholders --- srcs/juloo.keyboard2/KeyboardData.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'srcs/juloo.keyboard2/KeyboardData.java') diff --git a/srcs/juloo.keyboard2/KeyboardData.java b/srcs/juloo.keyboard2/KeyboardData.java index a106e03..225d8cc 100644 --- a/srcs/juloo.keyboard2/KeyboardData.java +++ b/srcs/juloo.keyboard2/KeyboardData.java @@ -608,6 +608,7 @@ public final class KeyboardData /** See [addExtraKeys()]. */ public final static class PreferredPos { + /** Default position for extra keys. */ public static final PreferredPos DEFAULT; public static final PreferredPos ANYWHERE; @@ -622,6 +623,9 @@ public final class KeyboardData public KeyPos[] positions = ANYWHERE_POSITIONS; public PreferredPos() {} + public PreferredPos(KeyValue next_to_) { next_to = next_to_; } + public PreferredPos(KeyPos[] pos) { positions = pos; } + public PreferredPos(KeyValue next_to_, KeyPos[] pos) { next_to = next_to_; positions = pos; } public PreferredPos(PreferredPos src) { @@ -634,13 +638,12 @@ public final class KeyboardData static { - DEFAULT = new PreferredPos(); - DEFAULT.positions = new KeyPos[]{ - new KeyPos(1, -1, 4), - new KeyPos(1, -1, 3), - new KeyPos(2, -1, 2), - new KeyPos(2, -1, 1) - }; + DEFAULT = new PreferredPos(new KeyPos[]{ + new KeyPos(1, -1, 4), + new KeyPos(1, -1, 3), + new KeyPos(2, -1, 2), + new KeyPos(2, -1, 1) + }); ANYWHERE = new PreferredPos(); } } -- cgit v1.2.3