abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2
diff options
context:
space:
mode:
authorJules Aguillon2021-04-20 00:34:21 +0200
committerJules Aguillon2021-04-20 00:34:21 +0200
commit5dec9c12154b6eec752c9fa88fde0b392b78db61 (patch)
tree935141d5d914bd7e9b12127da2762e6d3801def6 /srcs/juloo.keyboard2
parent83b3212d3d880e19ed6298d1182a88207d11be07 (diff)
downloadunexpected-keyboard-5dec9c12154b6eec752c9fa88fde0b392b78db61.tar.gz
unexpected-keyboard-5dec9c12154b6eec752c9fa88fde0b392b78db61.zip
Add a setting for precise repeat
Diffstat (limited to 'srcs/juloo.keyboard2')
-rw-r--r--srcs/juloo.keyboard2/Config.java3
-rw-r--r--srcs/juloo.keyboard2/Keyboard2View.java2
2 files changed, 4 insertions, 1 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java
index 366cc0c..779e2c5 100644
--- a/srcs/juloo.keyboard2/Config.java
+++ b/srcs/juloo.keyboard2/Config.java
@@ -23,6 +23,7 @@ class Config
public float keyHeight;
public float horizontalMargin;
public boolean disableAccentKeys;
+ public boolean preciseRepeat;
public boolean shouldOfferSwitchingToNextInputMethod;
@@ -46,6 +47,7 @@ class Config
keyHeight = res.getDimension(R.dimen.key_height);
horizontalMargin = res.getDimension(R.dimen.horizontal_margin);
disableAccentKeys = false;
+ preciseRepeat = true;
// from prefs
refresh();
// initialized later
@@ -68,6 +70,7 @@ class Config
keyHeight = getDipPref(prefs, "key_height", keyHeight);
horizontalMargin = getDipPref(prefs, "horizontal_margin", horizontalMargin);
disableAccentKeys = prefs.getBoolean("disable_accent_keys", disableAccentKeys);
+ preciseRepeat = prefs.getBoolean("precise_repeat", preciseRepeat);
}
private float getDipPref(SharedPreferences prefs, String pref_name, float def)
diff --git a/srcs/juloo.keyboard2/Keyboard2View.java b/srcs/juloo.keyboard2/Keyboard2View.java
index e59dd5f..3035d03 100644
--- a/srcs/juloo.keyboard2/Keyboard2View.java
+++ b/srcs/juloo.keyboard2/Keyboard2View.java
@@ -310,7 +310,7 @@ public class Keyboard2View extends View
{
long nextInterval = _config.longPressInterval;
boolean doVibrate = true;
- if ((key.flags & KeyValue.FLAG_PRECISE_REPEAT) != 0)
+ if (_config.preciseRepeat && (key.flags & KeyValue.FLAG_PRECISE_REPEAT) != 0)
{
// Modulate repeat interval depending on the distance of the pointer
float accel = Math.min(4.f, Math.max(0.3f, key.ptrDist / (_config.subValueDist * 15.f)));