Exemple #1
0
 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)
Exemple #2
0
 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)
Exemple #3
0
 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)
Exemple #4
0
def key_pressed_handler(widget, event, data=None):
    key_pressed = keyval_name(event.keyval).lower()
    print(key_pressed)