code: def lookup_character_keycode(self, character):
          
          keysym = Xlib.XK.string_to_keysym(character)
          if not keysym:
              try:
                  keysym = getattr(Xlib.keysymdef.xkb, 'XK_' + character, 0)
              except:
                  keysym = 0
          if not keysym:
              keysym = Xlib.XK.string_to_keysym(KEYSYMS[character])
          return self.display.keysym_to_keycode(keysym)
docs: Looks up the keysym for the character then returns the keycode mapping
          for that keysym.