def _on_key_press_event(self, widget, event): keyname = keyval_name(event.keyval) if keyname is not None: func = getattr(self, 'keypress_' + keyname.lower(), None) selected_rows = self.listview.get_selection().get_selected_rows()[1] if func and selected_rows: return func(event)
def on_key_press_event(self, widget, event): keyname = keyval_name(event.keyval) if keyname is not None: func = getattr(self, 'keypress_' + keyname.lower(), None) if func: return func(event)
def on_key_press_event(self, widget, event): keyname = keyval_name(event.keyval).lstrip('KP_').lower() if keyname.isdigit() or keyname in [ 'period', 'minus', 'delete', 'backspace' ]: self.button_apply.set_sensitive(True)
def key_pressed_handler(widget, event, data=None): key_pressed = keyval_name(event.keyval).lower() print(key_pressed)