code: def process_key_down(self, browser, keyboard, key, text, modifiers):
      # NOTE: Right alt modifier is not sent by Kivy through modifiers param.
      # print("---- on_key_down")
      # print("-- key="+str(key))
      # print(text) - utf-8 char
      # print("-- modifiers="+str(modifiers))
      # if text:
      #    print("-- ord(text)="+str(ord(text)))
  
      # CEF key event type:
      #   KEYEVENT_RAWKEYDOWN = 0
      #   KEYEVENT_KEYDOWN = 1
      #   KEYEVENT_KEYUP = 2
      #   KEYEVENT_CHAR = 3
  
      # Check if key is 'special'.
      # if we pass that to cefpython, it will crash.
      if key[1] == "special":
          return
  
      # On escape release the keyboard, see the injected in OnLoadStart()
      if key[0] == 27:
          browser.GetFocusedFrame().ExecuteJavascript(
              "__kivy__on_escape()"
          )
          return
  
      # Modify text for enter key
      if key[0] == 13:
          text = "\r"
  
      # CEF modifiers
      # When pressing ctrl also set modifiers for ctrl
      if key[0] in (306, 305):
          modifiers.append("ctrl")
      cef_modifiers = cefpython.EVENTFLAG_NONE
      if "shift" in modifiers:
          cef_modifiers |= cefpython.EVENTFLAG_SHIFT_DOWN
      if "ctrl" in modifiers:
          cef_modifiers |= cefpython.EVENTFLAG_CONTROL_DOWN
      if "alt" in modifiers:
          cef_modifiers |= cefpython.EVENTFLAG_ALT_DOWN
      if "capslock" in modifiers:
          cef_modifiers |= cefpython.EVENTFLAG_CAPS_LOCK_ON
  
      keycode = self.get_windows_key_code(key[0])
      charcode = key[0]
      if text:
          charcode = ord(text)
  
      # Do not send RAW-key for key-codes 35-40 aka ($#%&
      if key[0] not in range(35, 40 + 1):
          # Send key event to cef: RAWKEYDOWN
          key_event = {
              "type": cefpython.KEYEVENT_RAWKEYDOWN,
              "windows_key_code": keycode,
              "character": charcode,
              "unmodified_character": charcode,
              "modifiers": cef_modifiers,
          }
          # print("- DOWN RAW SendKeyEvent: %s" % key_event)
          browser.SendKeyEvent(key_event)
  
      # Send key event to cef: CHAR
      if text:
          key_event = {
              "type": cefpython.KEYEVENT_CHAR,
              "windows_key_code": keycode,
              "character": charcode,
              "unmodified_character": charcode,
              "modifiers": cef_modifiers,
          }
          # print("- DOWN text SendKeyEvent: %s" % key_event)
          browser.SendKeyEvent(key_event)
  
      if key[0] == 304:
          self.is_shift1 = True
      elif key[0] == 303:
          self.is_shift2 = True
      elif key[0] == 306:
          self.is_ctrl1 = True
      elif key[0] == 305:
          self.is_ctrl2 = True
      elif key[0] == 308:
          self.is_alt1 = True
      elif key[0] == 313:
          self.is_alt2 = True
  
file_path: SerpentAI/serpent/dashboard/cefbrowser/cefkeyboard.py
imports: from kivy.core.window import Window
  from .cefpython import cefpython
label_desc: Use image node_id 5 for calling the CEFKeyboardManagerSingleton obj's underlying member method code with example usage: obj.process_key_down(browser, keyboard, key, text, modifiers) without return types