code: def _handle_key(self, character, event):
          
          try:
              # Detect uppercase or shifted character
              shifted = self.is_char_shifted(character)
          except AttributeError:
              # Handle the case of integer keycode argument
              with display_manager(self.display) as d:
                  fake_input(d, event, character)
          else:
              with display_manager(self.display) as d:
                  if shifted:
                      fake_input(d, event, self.shift_key)
                  keycode = self.lookup_character_keycode(character)
                  fake_input(d, event, keycode)
docs: Handles either a key press or release, depending on ``event``.
  
          :param character: The key to handle. See :meth:`press_key` and
          :meth:`release_key` for information about this parameter.
  
          :param event: The *Xlib* event. This should be either
          :attr:`Xlib.X.KeyPress` or :attr:`Xlib.X.KeyRelease`