mooz/xkeysnail

Can't set multiple `multipurpose_modmap`

butter-radish opened this issue · 2 comments

I can't set two different multipurpose_modmaps at the same time. Trying to set the example from the example config:

define_multipurpose_modmap(
    {Key.ENTER: [Key.ENTER, Key.RIGHT_CTRL]}
    {Key.CAPSLOCK: [Key.ESC, Key.LEFT_CTRL]}
)

Gets me the following traceback:

  File "/usr/bin/xkeysnail", line 6, in <module>
    cli_main()
  File "/usr/lib/python3.10/site-packages/xkeysnail/__init__.py", line 62, in cli_main
    eval_file(args.config)
  File "/usr/lib/python3.10/site-packages/xkeysnail/__init__.py", line 6, in eval_file
    exec(compile(file.read(), path, 'exec'), globals())
  File "config.py", line 15
    {Key.ENTER: [Key.ENTER, Key.RIGHT_CTRL]}
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
Exception ignored in: <function InputDevice.__del__ at 0x7f5bef043640>
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/evdev/device.py", line 160, in __del__  File "/usr/lib/python3.10/site-packages/evdev/device.py", line 305, in close
  File "/usr/lib/python3.10/site-packages/evdev/eventio_async.py", line 55, in close
  File "/usr/lib/python3.10/asyncio/events.py", line 739, in get_event_loop_policy
  File "/usr/lib/python3.10/asyncio/events.py", line 732, in _init_event_loop_policy
ImportError: sys.meta_path is None, Python is likely shutting down

The syntax isn't wrong though? Idk what comma it's talking about.

define_multipurpose_modmap(
{
Key.ENTER: [Key.ENTER, Key.RIGHT_CTRL],
Key.CAPSLOCK: [Key.ESC, Key.LEFT_CTRL]
}
)

SH- tysm <3