forked from extern/Unexpected-Keyboard
Remove the interval between vibrations
This is no longer necessary since repeating key no longer cause a vibration.
This commit is contained in:
parent
fda53e3952
commit
402bf4990e
@ -18,16 +18,12 @@ import android.view.Window;
|
|||||||
public class Keyboard2View extends View
|
public class Keyboard2View extends View
|
||||||
implements View.OnTouchListener, Pointers.IPointerEventHandler
|
implements View.OnTouchListener, Pointers.IPointerEventHandler
|
||||||
{
|
{
|
||||||
private static final long VIBRATE_MIN_INTERVAL = 100;
|
|
||||||
|
|
||||||
private KeyboardData _keyboard;
|
private KeyboardData _keyboard;
|
||||||
|
|
||||||
private Pointers _pointers;
|
private Pointers _pointers;
|
||||||
|
|
||||||
private Pointers.Modifiers _mods;
|
private Pointers.Modifiers _mods;
|
||||||
|
|
||||||
private long _lastVibration = 0;
|
|
||||||
|
|
||||||
private static int _currentWhat = 0;
|
private static int _currentWhat = 0;
|
||||||
|
|
||||||
private Config _config;
|
private Config _config;
|
||||||
@ -189,17 +185,12 @@ public class Keyboard2View extends View
|
|||||||
|
|
||||||
private void vibrate()
|
private void vibrate()
|
||||||
{
|
{
|
||||||
long now = System.currentTimeMillis();
|
|
||||||
if ((now - _lastVibration) > VIBRATE_MIN_INTERVAL)
|
|
||||||
{
|
|
||||||
_lastVibration = now;
|
|
||||||
if (VERSION.SDK_INT >= 5)
|
if (VERSION.SDK_INT >= 5)
|
||||||
{
|
{
|
||||||
performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
|
performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
|
||||||
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
|
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMeasure(int wSpec, int hSpec)
|
public void onMeasure(int wSpec, int hSpec)
|
||||||
|
Loading…
Reference in New Issue
Block a user