abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Config.java
diff options
context:
space:
mode:
authorJules Aguillon2023-01-22 23:03:30 +0100
committerJules Aguillon2023-01-22 23:21:21 +0100
commit854eff211d62d566fdd3938a4bca1b0d63ad5958 (patch)
tree555a96911d7964fd35eb0abb112db74d96ef24be /srcs/juloo.keyboard2/Config.java
parentf4032e3be98b7e70fcd384537c3191cf7542c735 (diff)
downloadunexpected-keyboard-854eff211d62d566fdd3938a4bca1b0d63ad5958.tar.gz
unexpected-keyboard-854eff211d62d566fdd3938a4bca1b0d63ad5958.zip
Move cursor by sliding on the space bar
Send key events for the left or right arrow as the finger slides on the space bar. Can be used to select text by holding shift. Works under Termux. Events are sent linearly as the finger travels. The distance between each events is defined from the swiping distance divided by 4. 'slider="true"' can be set on a key that have 'edgekeys="true"'. 'key2' and 'key3' represent the right and left keys.
Diffstat (limited to 'srcs/juloo.keyboard2/Config.java')
-rw-r--r--srcs/juloo.keyboard2/Config.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java
index b8580e6..b9546b2 100644
--- a/srcs/juloo.keyboard2/Config.java
+++ b/srcs/juloo.keyboard2/Config.java
@@ -29,6 +29,7 @@ final class Config
// From the 'numpad_layout' option, also apply to the numeric pane.
public boolean inverse_numpad = false;
public float swipe_dist_px;
+ public float slide_step_px;
public boolean vibrateEnabled;
public long longPressTimeout;
public long longPressInterval;
@@ -118,6 +119,7 @@ final class Config
float swipe_scaling = Math.min(dm.widthPixels, dm.heightPixels) / 10.f * dpi_ratio;
float swipe_dist_value = Float.valueOf(_prefs.getString("swipe_dist", "15"));
swipe_dist_px = swipe_dist_value / 25.f * swipe_scaling;
+ slide_step_px = swipe_dist_px / 4.f;
vibrateEnabled = _prefs.getBoolean("vibrate_enabled", true);
longPressTimeout = _prefs.getInt("longpress_timeout", 600);
longPressInterval = _prefs.getInt("longpress_interval", 65);