forked from extern/Unexpected-Keyboard
Modify keys after a long press
This commit is contained in:
parent
5fac3459aa
commit
c46e3b6c61
@ -67,6 +67,12 @@ class KeyModifier
|
||||
}
|
||||
}
|
||||
|
||||
/** Modify a key after a long press. */
|
||||
public static KeyValue modify_long_press(KeyValue k)
|
||||
{
|
||||
return k;
|
||||
}
|
||||
|
||||
private static KeyValue apply_map_char(KeyValue k, Map_char map)
|
||||
{
|
||||
switch (k.getKind())
|
||||
|
@ -369,10 +369,21 @@ public final class Pointers implements Handler.Callback
|
||||
lockPointer(ptr, true);
|
||||
return false;
|
||||
}
|
||||
// Stop repeating: Latched key, special keys
|
||||
if (ptr.pointerId == -1 || (ptr.flags & KeyValue.FLAG_SPECIAL) != 0)
|
||||
// Stop repeating: Latched key, no key
|
||||
if (ptr.pointerId == -1 || ptr.value == null)
|
||||
return false;
|
||||
_handler.onPointerHold(ptr.value, ptr.modifiers);
|
||||
KeyValue kv = KeyModifier.modify_long_press(ptr.value);
|
||||
if (!kv.equals(ptr.value))
|
||||
{
|
||||
ptr.value = kv;
|
||||
ptr.flags = kv.getFlags();
|
||||
_handler.onPointerDown(true);
|
||||
return true;
|
||||
}
|
||||
// Stop repeating: Special keys
|
||||
if (kv.hasFlags(KeyValue.FLAG_SPECIAL))
|
||||
return false;
|
||||
_handler.onPointerHold(kv, ptr.modifiers);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user