mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-24 05:13:34 +00:00
fix: correct mac modifier and emoji key detection in input handler
This commit is contained in:
@@ -150,3 +150,21 @@ export function getMessageTypeClasses(type: MessageType): string {
|
||||
return severityColors["white"];
|
||||
}
|
||||
}
|
||||
|
||||
export function getModifierKey(): string {
|
||||
const isMac = /Mac/.test(navigator.userAgent);
|
||||
if (isMac) {
|
||||
return "⌘"; // Command key
|
||||
} else {
|
||||
return "Ctrl";
|
||||
}
|
||||
}
|
||||
|
||||
export function getEmojiKey(): string {
|
||||
const isMac = /Mac/.test(navigator.userAgent);
|
||||
if (isMac) {
|
||||
return "⌥"; // Option key
|
||||
} else {
|
||||
return "Ctrl";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user