Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
for-coursera opened this issue Mar 3, 2024 · 0 comments
Open

Comments

@for-coursera
Copy link

The situation:

  • Host machine: Debian, xkeysnail running
  • Guest machine: Debian, xkeysnail not installed
  • Host key (the key to press to return ownership of keyboard and mouse to the host OS): LCtrl+LShift

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant