diff --git a/timetagger/app/dialogs.py b/timetagger/app/dialogs.py index c21927e..27551cc 100644 --- a/timetagger/app/dialogs.py +++ b/timetagger/app/dialogs.py @@ -3849,6 +3849,7 @@ def open(self, callback=None): "T": "Select time range", "R": "Open report dialog", "I": "Open the guide", + "Backspace": "Unselect all tags", } shortcuts_html = "" for key, expl in shortcuts.items(): diff --git a/timetagger/app/front.py b/timetagger/app/front.py index cb6ec68..014530b 100644 --- a/timetagger/app/front.py +++ b/timetagger/app/front.py @@ -1462,6 +1462,8 @@ def _on_key(self, e): # elif e.key.lower() == "f": self._handle_button_press("search") + elif e.key.lower() == "backspace": + self._handle_button_press("select_none") # elif e.key.lower() == "arrowup" or e.key.lower() == "pageup": self._handle_button_press("nav_backward") @@ -1625,6 +1627,12 @@ def _handle_button_press(self, action): elif action == "nav_menu": self._canvas.timeselection_dialog.open() + elif action.startswith("select_"): + # A selection action + if action == "select_none": + self._canvas.widgets.AnalyticsWidget.selected_tags = [] + self._canvas.widgets.AnalyticsWidget.update() + class RecordsWidget(Widget): """Widget that draws the records, ticks, handles record