Exemplo n.º 1
0
 def mask_to_names(self, mask):
     mn = mask_to_names(mask, self._modifier_map)
     names = self._client_extras.current_modifiers(mn)
     if self.send_nuisance_modifiers:
         log.debug("mask_to_names(%s)=%s", mask, names)
         return  names
     #remove nuisance modifiers (lock, num, scroll):
     no_nuisance = [x for x in names if x not in DEFAULT_MODIFIER_NUISANCE]
     log.debug("mask_to_names(%s)=%s (raw=%s)", mask, no_nuisance, mn)
     return no_nuisance
Exemplo n.º 2
0
 def mask_to_names(self, mask):
     mn = mask_to_names(mask, self._modifier_map)
     names = self._client_extras.current_modifiers(mn)
     if self.send_nuisance_modifiers:
         log.debug("mask_to_names(%s)=%s", mask, names)
         return  names
     #remove nuisance modifiers (lock, num, scroll):
     no_nuisance = [x for x in names if x not in DEFAULT_MODIFIER_NUISANCE]
     log.debug("mask_to_names(%s)=%s (raw=%s)", mask, no_nuisance, mn)
     return no_nuisance
Exemplo n.º 3
0
 def _make_keymask_match(self, modifier_list):
     (_, _, current_mask) = gtk.gdk.get_default_root_window().get_pointer()
     current = set(mask_to_names(current_mask, self._modifier_map))
     wanted = set(modifier_list)
     log.debug("current mask: %s, wanted: %s", current, wanted)
     for modifier in current.difference(wanted):
         keyname = self._keyname_for_mod[modifier]
         log.debug("unpressing %s", keyname)
         xtest_fake_key(gtk.gdk.display_get_default(),
                        self._keycode(keyname),
                        False)
     for modifier in wanted.difference(current):
         keyname = self._keyname_for_mod[modifier]
         log.debug("pressing %s", keyname)
         xtest_fake_key(gtk.gdk.display_get_default(),
                        self._keycode(keyname),
                        True)
Exemplo n.º 4
0
 def mask_to_names(self, mask):
     return mask_to_names(mask, self._modifier_map)
Exemplo n.º 5
0
 def mask_to_names(self, mask):
     return mask_to_names(mask, self._modifier_map)
Exemplo n.º 6
0
 def mask_to_names(self, mask):
     mn = mask_to_names(mask, self._modifier_map)
     names = self._client_extras.current_modifiers(mn)
     return  names
Exemplo n.º 7
0
 def mask_to_names(self, mask):
     mn = mask_to_names(mask, self._modifier_map)
     names = mn
     if self._client_extras:
         names = self._client_extras.current_modifiers(mn)
     return names
Exemplo n.º 8
0
 def get_current_mask():
     _, _, current_mask = gtk.gdk.get_default_root_window().get_pointer(
     )
     return mask_to_names(current_mask, self.modifier_map)
Exemplo n.º 9
0
 def get_current_mask():
     _, _, current_mask = gtk.gdk.get_default_root_window().get_pointer()
     return mask_to_names(current_mask, self.modifier_map)
Exemplo n.º 10
0
 def get_current_mask():
     _, _, current_mask = gtk.gdk.get_default_root_window().get_pointer(
     )
     modifiers = mask_to_names(current_mask, self.modifier_map)
     debug("get_modifier_mask()=%s", modifiers)
     return modifiers