Problem with key triggering a toggle

i wonder about the following behaviour:
i have a configured a key which triggers a toggle button on keydown.
JS{{ if(@{toggle}) return 0; return 1;}} -> goes into the value of the toggle.
so on keydown the toggle changes its state.
works perfect. but now i switch on the toggle with the mouse.
and after that nothing happens anymore when pressing the key.
still the toggle is 1 in the JS which returns 0, but the toggle is not switched off and remains in state 1.
works again if i switch the toggle off with the mouse.
same problem if i do the other way round - switching the toggle on with the key and off with the mouse.
note: i’m still on version < 1 - not managed yet to do the heavy work in my case to migrate …

To avoid this you need to link the key widget and the toggle using linkId instead of putting @{key_id} in the toggle’s value property.

In v1 you’d do that with a single script widget responding to keyboard events:

// script property
// no JS{{}} wrapper
// using get() instead of @{}
set('toggle', get('toggle') ? 0 : 1)