LibWeb: Define a helper constant for the platform ctrl-ish key

For all intents and purposes, the cmd (super) key on macOS should be
treated as the ctrl key.

(cherry picked from commit 71b25e3e5a70937f1e2031b94541c04a68d28efa;
amended to fix minor conflict)
This commit is contained in:
Timothy Flynn
2024-08-01 12:45:41 -04:00
committed by Nico Weber
parent 6f9cdc377e
commit 02fae575ca
2 changed files with 16 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
#pragma once
#include <AK/EnumBits.h>
#include <AK/Platform.h>
#include <AK/Types.h>
#define ENUMERATE_KEY_CODES \
@@ -166,6 +167,12 @@ enum KeyModifier {
Mod_Mask = Mod_Alt | Mod_Ctrl | Mod_Shift | Mod_Super | Mod_AltGr | Mod_Keypad,
Is_Press = 0x80,
#if defined(AK_OS_MACOS)
Mod_PlatformCtrl = Mod_Super,
#else
Mod_PlatformCtrl = Mod_Ctrl,
#endif
};
AK_ENUM_BITWISE_OPERATORS(KeyModifier);