From 453268a3025eeebcfe28b2664919e0e0b0ab3c11 Mon Sep 17 00:00:00 2001 From: tomcw Date: Mon, 27 Feb 2023 22:42:57 +0000 Subject: [PATCH] Add command line: -capslock=off (#1187) --- source/CmdLine.cpp | 4 ++++ source/Keyboard.cpp | 5 +++++ source/Keyboard.h | 1 + 3 files changed, 10 insertions(+) diff --git a/source/CmdLine.cpp b/source/CmdLine.cpp index 9dfe9265..2665c190 100644 --- a/source/CmdLine.cpp +++ b/source/CmdLine.cpp @@ -397,6 +397,10 @@ bool ProcessCmdLine(LPSTR lpCmdLine) { KeybSetAltGrSendsWM_CHAR(true); } + else if (strcmp(lpCmdLine, "-capslock=off") == 0) // GH#1187 + { + KeybSetCapsLock(false); + } else if (strcmp(lpCmdLine, "-no-hook-alt") == 0) // GH#583 { JoySetHookAltKeys(false); diff --git a/source/Keyboard.cpp b/source/Keyboard.cpp index 5238279f..212ba69b 100644 --- a/source/Keyboard.cpp +++ b/source/Keyboard.cpp @@ -63,6 +63,11 @@ void KeybSetAltGrSendsWM_CHAR(bool state) g_bAltGrSendsWM_CHAR = state; } +void KeybSetCapsLock(bool state) +{ + g_bCapsLock = state; +} + //=========================================================================== void KeybReset() diff --git a/source/Keyboard.h b/source/Keyboard.h index cc244648..36afbc04 100644 --- a/source/Keyboard.h +++ b/source/Keyboard.h @@ -6,6 +6,7 @@ void ClipboardInitiatePaste(); void KeybReset(); void KeybSetAltGrSendsWM_CHAR(bool state); +void KeybSetCapsLock(bool state); bool KeybGetCapsStatus(); bool KeybGetAltStatus(); bool KeybGetCtrlStatus();