def lookup_character_keycode(self, character):
        """
        Looks up the keysym for the character then returns the keycode mapping
        for that keysym.
        """
        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)
Looks up the keysym for the character then returns the keycode mapping
        for that keysym.