docs: @SuppressWarnings("deprecation")
      MenuItem findItemWithShortcutForKey(int keyCode, KeyEvent event) {
          // Get all items that can be associated directly or indirectly with the keyCode
          ArrayList<MenuItem> items = mTempShortcutItemList;
          items.clear();
          findItemsWithShortcutForKey(items, keyCode, event);
  
          if (items.isEmpty()) {
              return null;
          }
  
          final int metaState = event.getMetaState();
          final KeyCharacterMap.KeyData possibleChars = new KeyCharacterMap.KeyData();
          // Get the chars associated with the keyCode (i.e using any chording combo)
          event.getKeyData(possibleChars);
  
          // If we have only one element, we can safely returns it
          final int size = items.size();
          if (size == 1) {
              return items.get(0);
          }
  
          final boolean qwerty = isQwertyMode();
          // If we found more than one item associated with the key,
          // we have to return the exact match
          for (int i = 0; i < size; i++) {
              final MenuItem item = items.get(i);
              final char shortcutChar = qwerty ? item.getAlphabeticShortcut() :
                      item.getNumericShortcut();
              if ((shortcutChar == possibleChars.meta[0] &&
                      (metaState & KeyEvent.META_ALT_ON) == 0)
                      || (shortcutChar == possibleChars.meta[2] &&
                      (metaState & KeyEvent.META_ALT_ON) != 0)
                      || (qwerty && shortcutChar == '\b' &&
                      keyCode == KeyEvent.KEYCODE_DEL)) {
                  return item;
              }
          }
          return null;
      }