Allow unmapping of keyboard shortcuts
This commit is contained in:
parent
5a5d07eef3
commit
12751a505c
@ -159,8 +159,11 @@ def load_config(path: str) -> Options:
|
||||
actions = frozenset(defaults.keymap.values())
|
||||
with f:
|
||||
vals = parse_config(f)
|
||||
remove_keys = {k for k, v in vals.get('keymap', {}).items() if v in ('noop', 'no-op', 'no_op')}
|
||||
vals['keymap'] = {k: v for k, v in vals.get('keymap', {}).items() if v in actions}
|
||||
ans = merge_dicts(vals, ans)
|
||||
for k in remove_keys:
|
||||
ans['keymap'].pop(k, None)
|
||||
return Options(**ans)
|
||||
|
||||
|
||||
|
||||
@ -122,6 +122,8 @@ color15 #ffffff
|
||||
# Key mapping
|
||||
# For a list of key names, see: http://www.glfw.org/docs/latest/group__keys.html
|
||||
# For a list of modifier names, see: http://www.glfw.org/docs/latest/group__mods.html
|
||||
# You can use the special action no_op to unmap a keyboard shortcut that is
|
||||
# assigned in the default configuration.
|
||||
|
||||
# Clipboard
|
||||
map ctrl+shift+v paste_from_clipboard
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user