Disable vibration when holding keys

This commit is contained in:
Jules Aguillon 2021-04-20 00:35:52 +02:00
parent 5dec9c1215
commit 66b7b532c9

View File

@ -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);
}
}