Skip to content

Instantly share code, notes, and snippets.

@netmarkjp
Created June 27, 2019 02:02
Show Gist options
  • Save netmarkjp/43e0dd409e3f4396a6f90bbe8519459c to your computer and use it in GitHub Desktop.
Save netmarkjp/43e0dd409e3f4396a6f90bbe8519459c to your computer and use it in GitHub Desktop.
Muhenkan treat like Alt ( only when combined usecase)
""" config """
import re
from xkeysnail.transform import K
from xkeysnail.transform import Key
from xkeysnail.transform import define_keymap
from xkeysnail.transform import define_modmap
from xkeysnail.transform import define_multipurpose_modmap
define_modmap({
Key.CAPSLOCK: Key.LEFT_CTRL
})
define_multipurpose_modmap({
Key.MUHENKAN: [Key.MUHENKAN, Key.LEFT_ALT],
})
APPLY_EMACSKEYS_WM_CLASSES = [
"Chromium",
"Google-chrome",
"Slack",
"copyq",
]
define_keymap(re.compile("|".join(APPLY_EMACSKEYS_WM_CLASSES), flags=re.I), {
K("C-b"): K("Left"),
K("C-f"): K("Right"),
K("C-p"): K("Up"),
K("C-n"): K("Down"),
K("C-a"): K("Home"),
K("C-e"): K("End"),
K("C-k"): [K("Shift-End"), K("Ctrl-x")],
K("C-d"): K("Delete"),
K("C-h"): K("BackSpace"),
K("Alt-a"): K("Ctrl-a"),
K("Alt-f"): K("Ctrl-f"),
}, "")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment