LED key then toggle led off

Asked by Arron

I want to have a button to toggle on the LED, then when I hit a button the alternate button is pressed and the led toggled off. here is my example:

Example:

[Map:n52]
# tab, key 1
KEY_TAB: KEY_F

# q, key 2
# toggle green
KEY_Q: LED_NUML@1. LED_NUML@0

[Map:n52 + LED_NUML]
# tab, key 1
# hit G and toggle off green
KEY_TAB: KEY_G, LED_NUML@0

key 1 works fine when I press it, the toggle green button turns it on and off. When I use the toggle green, then hit key 1 I get both F1 and G pressed. If I remove the ", LED_NUML@0" it works fine. Can I turn off the led somehow like this without the extra keypress?

Question information

Language:
English Edit question
Status:
Answered
For:
Pystromo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Raumkraut (raumkraut) said :
#1

I believe that you get both the F and G because the tab key is still being pressed when num-lock is 'released'. You could try putting in a small delay before the LED_NUML@0, to give you time to release the key before it takes effect:
KEY_TAB: KEY_G, 100, LED_NUML@0

Or it /might/ work to have the LED_NUML@0 part only be assigned to when you release KEY_TAB:
KEY_TAB@0: LED_NUML@0

I can't remember if/how this might work along-side a plain "KEY_TAB: KEY_G" definition though. Might be that it has no effect at all.

Can you help with this problem?

Provide an answer of your own, or ask Arron for more information if necessary.

To post a message you must log in.