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())
|
actions = frozenset(defaults.keymap.values())
|
||||||
with f:
|
with f:
|
||||||
vals = parse_config(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}
|
vals['keymap'] = {k: v for k, v in vals.get('keymap', {}).items() if v in actions}
|
||||||
ans = merge_dicts(vals, ans)
|
ans = merge_dicts(vals, ans)
|
||||||
|
for k in remove_keys:
|
||||||
|
ans['keymap'].pop(k, None)
|
||||||
return Options(**ans)
|
return Options(**ans)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -122,6 +122,8 @@ color15 #ffffff
|
|||||||
# Key mapping
|
# Key mapping
|
||||||
# For a list of key names, see: http://www.glfw.org/docs/latest/group__keys.html
|
# 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
|
# 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
|
# Clipboard
|
||||||
map ctrl+shift+v paste_from_clipboard
|
map ctrl+shift+v paste_from_clipboard
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user