You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Discovered an exception happening in a specific circumstance. This is just an example:
C("LC-Alt-RC-c"): C("C-c"),
The cause appears to be using both the left and right variants of a modifier on the input side of a remap, while having the same modifier involved in the output side, but undifferentiated. I think this will apply equally to attempting to use both left and right Super or Alt while having Super or Alt in the output combo. Or even the left/right Shift key.
This would normally be a very unusual thing to do, but with the Toshy or Kinto config if you need a general remap of something like Super+RC+key to work correctly in terminals, it has to become LC+RC+key since there is no Meta/Super/Win key available in terminals.
This particular type of shortcut remap causes something like the following to happen, and the shortcut will exhibit odd behavior or just not work:
Exception in callback receive_input(InputDevice('...input/event4')) at /home/kris/.config/toshy/.venv/lib64/python3.12/site-packages/xwaykeyz/input.py:105
handle: <Handle receive_input(InputDevice('...input/event4')) at /home/kris/.config/toshy/.venv/lib64/python3.12/site-packages/xwaykeyz/input.py:105>
Traceback (most recent call last):
File "/usr/lib64/python3.12/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/home/kris/.config/toshy/.venv/lib64/python3.12/site-packages/xwaykeyz/input.py", line 120, in receive_input
on_event(event, device)
File "/home/kris/.config/toshy/.venv/lib64/python3.12/site-packages/xwaykeyz/transform.py", line 389, in on_event
on_key(ks, context)
File "/home/kris/.config/toshy/.venv/lib64/python3.12/site-packages/xwaykeyz/transform.py", line 469, in on_key
transform_key(key, action, context)
File "/home/kris/.config/toshy/.venv/lib64/python3.12/site-packages/xwaykeyz/transform.py", line 516, in transform_key
reset_mode = handle_commands(keymap[combo], key, action, ctx, combo)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kris/.config/toshy/.venv/lib64/python3.12/site-packages/xwaykeyz/transform.py", line 614, in handle_commands
_output.send_combo(command)
File "/home/kris/.config/toshy/.venv/lib64/python3.12/site-packages/xwaykeyz/output.py", line 142, in send_combo
mods_we_need_to_press.remove(modifier)
File "<frozen _collections_abc>", line 729, in remove
KeyError: Ctrl<Key.LEFT_CTRL>
The exception can apparently be avoided by just differentiating between left and right modifiers in the output portion of the remap. Something that is not normally necessary or meaningful.
Either this:
C("LC-Alt-RC-c"): C("LC-c"),
Or this:
C("LC-Alt-RC-c"): C("RC-c"),
With the left/right differentiated modifier alias in the output side, suddenly the shortcuts all work correctly.
I think this has something to do with the resuming of suspended modifiers, but this is happening in a part of the code that I don't fully understand. I'm going to try to debug it at some point, but if you have any insights leave them here.
@joshgoebel
Discovered an exception happening in a specific circumstance. This is just an example:
The cause appears to be using both the left and right variants of a modifier on the input side of a remap, while having the same modifier involved in the output side, but undifferentiated. I think this will apply equally to attempting to use both left and right Super or Alt while having Super or Alt in the output combo. Or even the left/right Shift key.
This would normally be a very unusual thing to do, but with the Toshy or Kinto config if you need a general remap of something like
Super+RC+key
to work correctly in terminals, it has to becomeLC+RC+key
since there is no Meta/Super/Win key available in terminals.This particular type of shortcut remap causes something like the following to happen, and the shortcut will exhibit odd behavior or just not work:
The exception can apparently be avoided by just differentiating between left and right modifiers in the output portion of the remap. Something that is not normally necessary or meaningful.
Either this:
Or this:
With the left/right differentiated modifier alias in the output side, suddenly the shortcuts all work correctly.
I think this has something to do with the resuming of suspended modifiers, but this is happening in a part of the code that I don't fully understand. I'm going to try to debug it at some point, but if you have any insights leave them here.
This came up in Toshy issue #408.
The text was updated successfully, but these errors were encountered: