better usability
This commit is contained in:
@@ -563,7 +563,17 @@ class ChtWindow(Adw.ApplicationWindow):
|
||||
|
||||
def _setup_keyboard(self):
|
||||
kb = KeyboardManager()
|
||||
kb.set_passthrough(lambda: self.get_focus() is self._input_entry, except_keys={KEY_ESCAPE})
|
||||
def _entry_focused():
|
||||
focus = self.get_focus()
|
||||
if focus is None:
|
||||
return False
|
||||
w = focus
|
||||
while w is not None:
|
||||
if w is self._input_entry:
|
||||
return True
|
||||
w = w.get_parent()
|
||||
return False
|
||||
kb.set_passthrough(_entry_focused, except_keys={KEY_ESCAPE})
|
||||
kb.bind(KEY_LEFT, lambda **_: self._frames_panel.select_adjacent(-1))
|
||||
kb.bind(KEY_RIGHT, lambda **_: self._frames_panel.select_adjacent(1))
|
||||
kb.bind(KEY_UP, lambda shift=False, **_: self._transcript_panel.select_adjacent(-1, extend=shift))
|
||||
|
||||
Reference in New Issue
Block a user