Disable Specific Key for 5 Seconds After Being Pressed
#1
In need of a specific solution to help my elderly father use his keyboard as a controller. He will often press and hold a key simply because in his old age his response time has slowed. He also will sometimes press - and hold - the key until something happens on screen.

Is anyone here familiar with how to disable a key immediately after being pressed for a period of time? I have looked around but have only learned how to configure a remote delay. We are using a traditional wireless USB keyboard. I imagine this would require a python script, but I am unsure how to query the current key pressed, let alone how to activate or deactivate specific keys.

Alternatively, if a method exists for controlled the key repeat rate within koi (or OSMC, which is the flavor I am using) that would be helpful as well.

I did try using the longpress property in the keymap, but this did nothing. I imagine that is not something used for keyboards, but instead for remotes.
Reply
#2
longpress should work for keyboards as well. It should actually do what you want, as it will disable key-repeat. Just use the same action for both short and long presses.
Reply
#3
(2016-02-26, 06:52)Ned Scott Wrote: longpress should work for keyboards as well. It should actually do what you want, as it will disable key-repeat. Just use the same action for both short and long presses.

I tested that with this in the keymap:

<d>VolumeUp</d>
<d mod="longpress">Mute</d>

I set them different just to test if the long press mod functioned with keyboards. It seems it does not unfortunately. But thank you for your help, I appreciate you taking the time to reply. Smile And if I am wrong, or appear to be configuring something wrong please let me know!

EDIT: Alas, it seems long press is unavailable for keyboards. (http://trac.kodi.tv/ticket/10932)
Reply
#4
Thread moved to is independent.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#5
Longpress for keyboards works for me on OS X and Android. What OS are you using?
Reply
#6
Note that long keypress currently doesn't work if the os is sending repeating down/up messages (rather than down/down/down/... /up).

I started looking at this (because my cec config is doing exactly that), but it's not that easy, especially because it's hard to distinguish a repeating up from a final one without implementing some kind of timeout, which renders keypresses generally sluggish...

P.S If the os has an "auto-repeat" setting, maybe try to disable it.
Reply

Logout Mark Read Team Forum Stats Members Help
Disable Specific Key for 5 Seconds After Being Pressed0