From 72b56a61569ef545f32dad2b93ad4db964f8494f Mon Sep 17 00:00:00 2001 From: Alex Pantechovskis Date: Tue, 20 Oct 2020 16:46:02 +0300 Subject: [PATCH] Don't close/accept macro dialog on esc/enter to allow binding these keys (#565) closes #322 --- data/ui/ButtonDialog.ui | 17 ----------------- piper/buttondialog.py | 13 ------------- 2 files changed, 30 deletions(-) diff --git a/data/ui/ButtonDialog.ui b/data/ui/ButtonDialog.ui index d5b1278..0156044 100644 --- a/data/ui/ButtonDialog.ui +++ b/data/ui/ButtonDialog.ui @@ -214,23 +214,6 @@ 2 - - - True - False - Press Escape to cancel or Return to accept. - True - False - - - - False - True - 3 - - capture diff --git a/piper/buttondialog.py b/piper/buttondialog.py index 38ce07f..72ec96f 100644 --- a/piper/buttondialog.py +++ b/piper/buttondialog.py @@ -277,19 +277,6 @@ class ButtonDialog(Gtk.Dialog): if event.type == Gdk.EventType.KEY_PRESS: type = RatbagdButton.Macro.KEY_PRESS - - # Return accepts the current keystroke. - if event.keyval == Gdk.KEY_Return: - self._current_macro.accept() - return - # Escape cancels the editing. - elif event.keyval == Gdk.KEY_Escape: - if self._action_type == RatbagdButton.ActionType.MACRO: - self._create_current_macro(macro=self._mapping) - else: - self._create_current_macro() - self.stack.set_visible_child_name("overview") - return elif event.type == Gdk.EventType.KEY_RELEASE: type = RatbagdButton.Macro.KEY_RELEASE