Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Fixed key binding reset key #132

Merged
merged 1 commit into from
Feb 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions mcomix/mcomix/keybindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,19 @@ def clear_all(self):
self._action_to_callback = {}
self._action_to_bindings = defaultdict(list)
self._binding_to_action = {}

stored_action_bindings = keybindings_map.DEFAULT_BINDINGS.copy()

for action in keybindings_map.BINDING_INFO.keys():
if action in stored_action_bindings:
bindings = [
Gtk.accelerator_parse(keyname)
for keyname in stored_action_bindings[action] ]
self._action_to_bindings[action] = bindings
for binding in bindings:
self._binding_to_action[binding] = action
else:
self._action_to_bindings[action] = []

def execute(self, keybinding):
''' Executes an action that has been registered for the
Expand Down