forked from extern/Unexpected-Keyboard
Fix latched pointers accumulating on the same key
It was possible to latch and lock the same modifier several time at the same time independently. Remove that.
This commit is contained in:
@ -61,7 +61,8 @@ public final class Pointers implements Handler.Callback
|
||||
*/
|
||||
public int getKeyFlags(KeyValue kv)
|
||||
{
|
||||
// Use physical equality because the key might have been modified.
|
||||
// Comparing names because the keys might have been modified.
|
||||
// Physical equality works because names are never computed or shared.
|
||||
String name = kv.name;
|
||||
for (Pointer p : _ptrs)
|
||||
if (p.value != null && p.value.name == name)
|
||||
@ -207,9 +208,11 @@ public final class Pointers implements Handler.Callback
|
||||
private Pointer getLatched(Pointer target)
|
||||
{
|
||||
KeyboardData.Key k = target.key;
|
||||
int vi = target.value_index;
|
||||
KeyValue v = target.value;
|
||||
if (v == null)
|
||||
return null;
|
||||
for (Pointer p : _ptrs)
|
||||
if (p.key == k && p.value_index == vi && p.pointerId == -1)
|
||||
if (p.key == k && p.pointerId == -1 && p.value != null && p.value.name == v.name)
|
||||
return p;
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user