def METHOD_NAME(scanCode: int, isExtended: bool, shiftPressed: bool, capsLockOn: bool) -> str:
    if not isExtended:
        key = findKeyForScanCode(scanCode)
    elif scanCode == SCANCODE_MAPPING[Qt.Key.Key_Control]:
        key = Qt.Key.Key_Control
    # Numpad slash
    elif scanCode == 0x35:
        key = Qt.Key.Key_Slash
    else:
        key = None
        for extendedKey in EXTENDED_KEYS:
            if extendedKey in SCANCODE_MAPPING and SCANCODE_MAPPING[extendedKey] == scanCode:
                key = extendedKey
                break
            elif extendedKey in SCANCODE_MAPPING_NUMPAD and SCANCODE_MAPPING_NUMPAD[extendedKey] == scanCode:
                key = extendedKey
                break
        if key is None:
            return f"Unknown scan code {hex(scanCode)}"
    if key < 0x1000000:
        name = chr(key)
        if name.isalpha():
            return name.upper() if shiftPressed or capsLockOn else name.lower()
        else:
            key = shiftKey(key) if shiftPressed else key
            return chr(key)
    elif key == Qt.Key.Key_Meta:
        return "Windows"
    enumName = str(key)
    return " ".join(enumName.split("_")[1 :])