diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml index ffdc013..0e645a7 100644 --- a/res/values-cs/strings.xml +++ b/res/values-cs/strings.xml @@ -40,6 +40,7 @@ Tato aplikace neobsahuje žádné reklamy, nevyužívá připojení k síti a je Jak daleko je třeba posunout prst pro zadání znaku/znaménka v rohu klávey (%s) Interval opakování znaků + Dvojklik pro aktivaci Capslock(u) Umožňuje zamknout Shift dvojklikem, namísto podržení Chování diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 32b57c0..8a63e4c 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -40,6 +40,7 @@ Diese App enthält keine Werbung, benötigt keinen Netzwerkzugriff und ist quell Abstand der Zeichen in den Ecken der Tasten (%s) Intervall der Tastenwiederholung + Umschalttaste mit Doppeltippen einrasten Anstatt Taste längere Zeit gedrückt zu halten Verhalten diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index 534c734..9f3322d 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -40,6 +40,7 @@ La misma no contiene ningún anuncio/publicidad, no realiza peticiones de red y Distancia de caracteres en las esquinas de las teclas (%s) Intervalo de repetición de tecla + Doble toque en Mayús para bloquear las mayúsculas Se puede bloquear cualquier modificador manteniéndolo presionado Comportamiento diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml index b881889..f76e689 100644 --- a/res/values-fa/strings.xml +++ b/res/values-fa/strings.xml @@ -40,6 +40,7 @@ This application contains no ads, doesn't make any network requests and is Open فاصله حروف از گوشه‌های کلیدها )(%s) فاصله تکرار کلید + دوبار ضربه روی دگرساز برای فعال شدن کپس لاک شما میتوانید قفل کنید هر میانبری را با نگه داشتن آن ٰرفتار diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index d863cc5..ba7d21a 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -40,6 +40,7 @@ Cette application ne contient pas de publicité, n'accède pas au réseau et est La distance des caractères dans les coins (%s) Écart entre les répétitions + Appuyer deux fois pour bloquer la majuscule Un appui long bloque la majuscule Comportement diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index 2097e56..f4da65d 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -40,6 +40,7 @@ This application contains no ads, doesn't make any network requests and is Open Distanza dei caratteri negli angoli dei tasti (%s) Intervallo ripetizione tasto + Doppio tocco su Shift per attivare CapsLock Invece di premere i modificatori a lungo diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml index 67f9b32..20844c2 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -40,6 +40,7 @@ This application contains no ads, doesn't make any network requests and is Open 키 모서리 문자의 입력 범위 (%s) 키 반복 간격 + diff --git a/res/values-lv/strings.xml b/res/values-lv/strings.xml index 0bc39fe..7ae25b3 100644 --- a/res/values-lv/strings.xml +++ b/res/values-lv/strings.xml @@ -40,6 +40,7 @@ Tagad lieliski piemērota izmantošanai ikdienā. Taustiņu stūros esošo rakstzīmju attālums (%s) Taustiņa atkārtošanās aizture + Divkāršs piesitiens burtslēgam Tā vietā, lai ilstoši piespiestu pārveidotāju Uzvedība diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index 68c10f4..4531c8f 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -40,6 +40,7 @@ Aplikacja nie zawiera reklam, nie żąda dostępu do internetu, a jej kod źród Odległość znaków od rogów klawiszy (%s) Czas pomiędzy powtórzeniami + Naciśnij Shift podwójnie, aby włączyć caps lock Możesz zablokować modyfikator poprzez jego długie naciśnięcie Zachowanie diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml index fed1105..1d98260 100644 --- a/res/values-pt/strings.xml +++ b/res/values-pt/strings.xml @@ -40,6 +40,7 @@ Este aplicativo não contém anúncios, não faz nenhuma solicitação de rede e Distância até acionar os cantos das teclas (%s) Intervalo de repetição de tecla + Tecle duas vezes no shift para travá-lo acionado Ao invés de apertar e segurar por um tempo Comportamento diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml index 5dd13bc..b68f15e 100644 --- a/res/values-ro/strings.xml +++ b/res/values-ro/strings.xml @@ -40,6 +40,7 @@ Această aplicație nu conține publicitate, nu folosește rețeaua deloc și e Distanța dintre caracterele din colțurile tastelor (%s) Intervalul de repetare a tastelor + Apăsare dublă pe Shift activează Caps Lock Puteți activa orice modificator, ținându-l apăsat Comportament diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 6572103..c7b7e78 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -40,6 +40,7 @@ Расстояние между символами в углах клавиш (%s) Интервал повтора клавиш + CapsLock двойным нажатием Shift Также можно активировать модификатор долгим нажатием Поведение diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml index 0d608cc..4a77bbc 100644 --- a/res/values-tr/strings.xml +++ b/res/values-tr/strings.xml @@ -40,6 +40,7 @@ Bu uygulama açık kaynaklıdır. Reklam içermez ve internete bağlanmaz."Tuşların köşelerinden kaydırma mesafesi (%s) Tuşların tekrarlama sıklığı + CapsLock için Shift tuşuna çift bas Uzun basarak CapsLock açılabilir Klavye davranışı diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml index a3c5253..93af083 100644 --- a/res/values-uk/strings.xml +++ b/res/values-uk/strings.xml @@ -40,6 +40,7 @@ Відстань між символами в кутах клавіш (%s) Інтервал повторення клавіш + Двічі торкніться Shift для Caps Lock Ви можете заблокувати будь-який модифікатор, утримуючи його Поведінка diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml index 46f6657..8ea468d 100644 --- a/res/values-vi/strings.xml +++ b/res/values-vi/strings.xml @@ -40,6 +40,7 @@ Bây giờ đã hoàn hảo cho việc sử dụng hàng ngày. Khoảng cách giữa các ký tự ở góc phím (%s) Khoảng thời gian lặp phím + Nhấn hai lần Shift để bật Caps Lock Bạn có thể khóa phím hỗ trợ bằng cách giữ vào nó diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index c585829..89b6c28 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -40,6 +40,7 @@ 输入按键四角的符号需要滑动的距离 (%s) 长按后每次重复输入的时间间隔 + 双击 Shift 键锁定大写 任何时候长按修饰键均可将其锁定 行为 diff --git a/res/values/strings.xml b/res/values/strings.xml index a61b12c..224aca5 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -40,6 +40,7 @@ This application contains no ads, doesn't make any network requests and is Open Distance of characters in the corners of the keys (%s) Long press timeout Key repeat interval + Key repeat on long press Double tap on shift for caps lock You can lock any modifier by holding it Behavior diff --git a/res/xml/settings.xml b/res/xml/settings.xml index 270dfcd..c6c553a 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -16,7 +16,8 @@ - + + diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java index 8b72bc7..7570728 100644 --- a/srcs/juloo.keyboard2/Config.java +++ b/srcs/juloo.keyboard2/Config.java @@ -47,6 +47,7 @@ public final class Config public long vibrate_duration; public long longPressTimeout; public long longPressInterval; + public boolean keyrepeat_enabled; public float margin_bottom; public float keyHeight; public float horizontal_margin; @@ -152,6 +153,7 @@ public final class Config vibrate_duration = _prefs.getInt("vibrate_duration", 20); longPressTimeout = _prefs.getInt("longpress_timeout", 600); longPressInterval = _prefs.getInt("longpress_interval", 65); + keyrepeat_enabled = _prefs.getBoolean("keyrepeat_enabled", true); margin_bottom = get_dip_pref_oriented(dm, "margin_bottom", 7, 3); key_vertical_margin = get_dip_pref(dm, "key_vertical_margin", 1.5f) / 100; key_horizontal_margin = get_dip_pref(dm, "key_horizontal_margin", 2) / 100; diff --git a/srcs/juloo.keyboard2/Pointers.java b/srcs/juloo.keyboard2/Pointers.java index 55ca9c5..0b24b8f 100644 --- a/srcs/juloo.keyboard2/Pointers.java +++ b/srcs/juloo.keyboard2/Pointers.java @@ -24,14 +24,14 @@ public final class Pointers implements Handler.Callback /** Can't be locked, even when long pressing. */ public static final int FLAG_P_CANT_LOCK = (1 << 7); - private Handler _keyrepeat_handler; + private Handler _longpress_handler; private ArrayList _ptrs = new ArrayList(); private IPointerEventHandler _handler; private Config _config; public Pointers(IPointerEventHandler h, Config c) { - _keyrepeat_handler = new Handler(this); + _longpress_handler = new Handler(this); _handler = h; _config = c; } @@ -62,7 +62,7 @@ public final class Pointers implements Handler.Callback public void clear() { for (Pointer p : _ptrs) - stopKeyRepeat(p); + stopLongPress(p); _ptrs.clear(); } @@ -142,7 +142,7 @@ public final class Pointers implements Handler.Callback ptr.sliding.onTouchUp(ptr); return; } - stopKeyRepeat(ptr); + stopLongPress(ptr); KeyValue ptr_value = ptr.value; if (ptr.gesture != null && ptr.gesture.is_in_progress()) { @@ -206,7 +206,7 @@ public final class Pointers implements Handler.Callback KeyValue value = _handler.modifyKey(key.keys[0], mods); Pointer ptr = new Pointer(pointerId, key, value, x, y, mods); _ptrs.add(ptr); - startKeyRepeat(ptr); + startLongPress(ptr); _handler.onPointerDown(value, false); } @@ -313,7 +313,7 @@ public final class Pointers implements Handler.Callback else { ptr.value = apply_gesture(ptr, ptr.gesture.get_gesture()); - restartKeyRepeat(ptr); + restartLongPress(ptr); ptr.flags = 0; // Special behaviors are ignored during a gesture. } } @@ -382,7 +382,7 @@ public final class Pointers implements Handler.Callback // Key repeat - /** Message from [_keyrepeat_handler]. */ + /** Message from [_longpress_handler]. */ @Override public boolean handleMessage(Message msg) { @@ -390,11 +390,7 @@ public final class Pointers implements Handler.Callback { if (ptr.timeoutWhat == msg.what) { - if (handleKeyRepeat(ptr)) - _keyrepeat_handler.sendEmptyMessageDelayed(msg.what, - _config.longPressInterval); - else - ptr.timeoutWhat = -1; + handleLongPress(ptr); return true; } } @@ -403,60 +399,62 @@ public final class Pointers implements Handler.Callback private static int uniqueTimeoutWhat = 0; - private void startKeyRepeat(Pointer ptr) + private void startLongPress(Pointer ptr) { int what = (uniqueTimeoutWhat++); ptr.timeoutWhat = what; - _keyrepeat_handler.sendEmptyMessageDelayed(what, _config.longPressTimeout); + _longpress_handler.sendEmptyMessageDelayed(what, _config.longPressTimeout); } - private void stopKeyRepeat(Pointer ptr) + private void stopLongPress(Pointer ptr) { - if (ptr.timeoutWhat != -1) - { - _keyrepeat_handler.removeMessages(ptr.timeoutWhat); - ptr.timeoutWhat = -1; - } + _longpress_handler.removeMessages(ptr.timeoutWhat); } - private void restartKeyRepeat(Pointer ptr) + private void restartLongPress(Pointer ptr) { - stopKeyRepeat(ptr); - startKeyRepeat(ptr); + stopLongPress(ptr); + startLongPress(ptr); } - /** A pointer is repeating. Returns [true] if repeat should continue. */ - private boolean handleKeyRepeat(Pointer ptr) + /** A pointer is long pressing. */ + private void handleLongPress(Pointer ptr) { // Long press toggle lock on modifiers if ((ptr.flags & FLAG_P_LATCHABLE) != 0) { if (!ptr.hasFlagsAny(FLAG_P_CANT_LOCK)) lockPointer(ptr, true); - return false; + return; } - // Stop repeating: Latched key, no key + // Latched key, no key if (ptr.hasFlagsAny(FLAG_P_LATCHED) || ptr.value == null) - return false; + return; + // Key is long-pressable KeyValue kv = KeyModifier.modify_long_press(ptr.value); if (!kv.equals(ptr.value)) { ptr.value = kv; _handler.onPointerDown(kv, true); - return true; + return; } - // Stop repeating: Special keys + // Special keys if (kv.hasFlagsAny(KeyValue.FLAG_SPECIAL)) - return false; - _handler.onPointerHold(kv, ptr.modifiers); - return true; + return; + // For every other keys, key-repeat + if (_config.keyrepeat_enabled) + { + _handler.onPointerHold(kv, ptr.modifiers); + _longpress_handler.sendEmptyMessageDelayed(ptr.timeoutWhat, + _config.longPressInterval); + } } // Sliding void startSliding(Pointer ptr, float x) { - stopKeyRepeat(ptr); + stopLongPress(ptr); ptr.flags |= FLAG_P_SLIDING; ptr.sliding = new Sliding(x); }