mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2024-11-22 07:13:13 +01:00
Disable vibration when holding keys
This commit is contained in:
parent
5dec9c1215
commit
66b7b532c9
@ -309,18 +309,14 @@ public class Keyboard2View extends View
|
||||
if (key.timeoutWhat == msg.what)
|
||||
{
|
||||
long nextInterval = _config.longPressInterval;
|
||||
boolean doVibrate = true;
|
||||
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)));
|
||||
nextInterval = (long)((float)nextInterval / accel);
|
||||
doVibrate = false;
|
||||
}
|
||||
_handler.sendEmptyMessageDelayed(msg.what, nextInterval);
|
||||
((Keyboard2)getContext()).handleKeyUp(key.value, _flags);
|
||||
if (doVibrate)
|
||||
vibrate();
|
||||
return (true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user