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
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)
def mask_to_names(self, mask): return mask_to_names(mask, self._modifier_map)
def mask_to_names(self, mask): mn = mask_to_names(mask, self._modifier_map) names = self._client_extras.current_modifiers(mn) return names
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
def get_current_mask(): _, _, current_mask = gtk.gdk.get_default_root_window().get_pointer( ) return mask_to_names(current_mask, self.modifier_map)
def get_current_mask(): _, _, current_mask = gtk.gdk.get_default_root_window().get_pointer() return mask_to_names(current_mask, self.modifier_map)
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