From 854eff211d62d566fdd3938a4bca1b0d63ad5958 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 22 Jan 2023 23:03:30 +0100 Subject: 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. --- srcs/juloo.keyboard2/Config.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'srcs/juloo.keyboard2/Config.java') 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); -- cgit v1.2.3