Skip to content Skip to sidebar Skip to footer

Keyevent Getrepeatcount() Always Return 0

I'm working with remote android TV To catch event when use press remote button I use this code: public boolean dispatchKeyEvent(KeyEvent event) { Log.d('LOG', 'Number repea

Solution 1:

When you press a key, release it, and then press it again, you will receive two ACTION_DOWN events, and getRepeatCount() will return 0 for both. To see a non-zero getRepeatCount() value, you have to hold down the key long enough that it starts repeating.

You can think about it like this. If I type "aaaaaaaaaa" into this text field by pressing and releasing my keyboard's A key 10 times, I'll get 10 events, each with a repeat count of zero. But if I hold my A key down long enough that I start getting multiple "a"s, then I'll get 10 events, each with an increasing repeat count.

Post a Comment for "Keyevent Getrepeatcount() Always Return 0"