Alexandru <
alexandr...@meshparts.de> wrote:
> Am Dienstag, 9. April 2019 23:10:11 UTC+2 schrieb Alexandru:
>> Hi,
>> Is there reason why the binding to KeyRelease works while to KeyPress it does not?
>> bind . <Control-KeyRelease> {puts release} ;# Works
>> bind . <Control-KeyPress> {puts press} ;# Does not work
> Looks like I need to bind <Control_L> instead of <Control-KeyPress>
Not sure I see the same symptom.
If I press Ctrl-A on the tk window, I do see a press and release for the "a"
plus an extra release for releasing the Ctrl-key itself.
So, if you meant watching the Ctrl-Key itself, then be reminded, that
Control before the dash is a modifier, that means that "some key action
happens, while Ctrl is already pressed". This is not the case while
you press Ctrl itself, but it is while you release it.
In the other case you check for the left Control key itself, so you
get the events on when it is used, not just when it is held while
another key is used.
PS: you might also want to bind for Control_R, or only one of the Ctrl
keys will work :)