(self)
Bind keys from config
Bind keys from config
Bind keys from config
def _bind_keys(self):
        """ Bind keys from config """
        config = self._get_config()
        for key, command in config['keys']['commands'].items():
            # See https://developer.gnome.org/gtk3/stable/gtk3-Keyboard-Accelerators.html#gtk-accelerator-parse
            keysym, modmask = Gtk.accelerator_parse(config['keys']['accelerator'] + key)
            keycode = self.display.keysym_to_keycode(keysym)

            self.keys[keycode] = command
            self.root.grab_key(keycode, modmask, 1, X.GrabModeAsync, X.GrabModeAsync)
def _bind_keys ( self ) : config = self . _get_config ( ) for key , command in config [ 'keys' ] [ 'commands' ] . items ( ) : # See https://developer.gnome.org/gtk3/stable/gtk3-Keyboard-Accelerators.html#gtk-accelerator-parse keysym , modmask = Gtk . accelerator_parse ( config [ 'keys' ] [ 'accelerator' ] + key ) keycode = self . display . keysym_to_keycode ( keysym ) self . keys [ keycode ] = command self . root . grab_key ( keycode , modmask , 1 , X . GrabModeAsync , X . GrabModeAsync )