def do_keys_changed(): self._keymap_changing = False if self.locked: #automatic changes not allowed! log.info("ignoring keymap change: layout is locked to '%s'", self.layout_str()) return if self.update(): log.info("keymap has been changed to '%s', sending updated mappings to the server", self.layout_str()) if self.xkbmap_layout: self.send_layout() self.send_keymap()
def do_keys_changed(): #re-register the change handler: self._keymap_change_handler_id = self._keymap.connect("keys-changed", self.keymap_changed) self._keymap_changing = False if self.locked: #automatic changes not allowed! log.info("ignoring keymap change: layout is locked to '%s'", self.layout_str()) return if self.update(): log.info("keymap has been changed to '%s', sending updated mappings to the server", self.layout_str()) if self.xkbmap_layout: self.send_layout() self.send_keymap()
def _do_keys_changed(self, send_if_changed=False): self._keymap_changing = False old_hash = self.hash self.query_xkbmap() try: self.keyboard.update_modifier_map(gdk.display_get_default(), self.xkbmap_mod_meanings) except: pass log("do_keys_changed() modifier_map=%s, old hash=%s, new hash=%s", self.keyboard.modifier_map, old_hash, self.hash) if send_if_changed and old_hash!=self.hash: log.info("keymap has changed, sending updated mappings to the server") if self.xkbmap_layout: self.send_layout() self.send_keymap()
def _do_keys_changed(self, send_if_changed=False): self._keymap_changing = False old_hash = self.hash self.query_xkbmap() try: self.keyboard.update_modifier_map(gdk.display_get_default(), self.xkbmap_mod_meanings) except: pass log("do_keys_changed() modifier_map=%s, old hash=%s, new hash=%s", self.keyboard.modifier_map, old_hash, self.hash) if send_if_changed and old_hash != self.hash: log.info( "keymap has changed, sending updated mappings to the server") if self.xkbmap_layout: self.send_layout() self.send_keymap()