mooz / xkeysnail

Yet another keyboard remapping tool for X environment
890 stars 112 forks source link

VirtualBox: first, send the Host key, next, send the actual binding #178

Open for-coursera opened 5 months ago

for-coursera commented 5 months ago

The situation:

I other words, if I want to switch to another task on the host machine, I first press LCtrl+LShift, and then Alt+Tab. Because of that, I thought, let's create an xkeysnail Alt+Tab binding for VirtualBox only:

define_keymap(re.compile(".*VirtualBox Machine"), {
    K("Alt-Tab") : [K("LCtrl-LShift"), K("Alt-Tab")],
}

But then, xkeysnail fails to start -- probably, because the actual key is missing for the LCtrl-LShift pair?

v0.4.0

Traceback (most recent call last):
  File "/usr/local/bin/xkeysnail", line 6, in <module>
    cli_main()
  File "/usr/local/lib/python3.10/dist-packages/xkeysnail/__init__.py", line 62, in cli_main
    eval_file(args.config)
  File "/usr/local/lib/python3.10/dist-packages/xkeysnail/__init__.py", line 6, in eval_file
    exec(compile(file.read(), path, 'exec'), globals())
  File "/home/me/.config/xkeysnail/config.py", line 91, in <module>
    K("Alt-Tab") : [K("LCtrl-LShift"), K("Alt-Tab")],
  File "/usr/local/lib/python3.10/dist-packages/xkeysnail/transform.py", line 144, in K
    key = getattr(Key, key_str)
  File "/usr/lib/python3.10/enum.py", line 437, in __getattr__
    raise AttributeError(name) from None
AttributeError: LSHIFT

Is there any workaround, maybe? Would be grateful for an advise :)