Login Page - Create Account

Support Board


Date/Time: Mon, 16 Sep 2024 19:54:29 +0000



Post From: Is There A Way To Detect Whether Caps Lock Is On Or Off?

[2023-01-31 22:27:06]
ondafringe - Posts: 276
You can in ACSIL.

Convert the Windows Key Code for Caps Lock in hex (0x14) to decimal (20).

if (sc.SetDefaults)
{

//Other Code

sc.ReceiveKeyboardKeyEvents = true;

return;
}

int pressedKey = sc.KeyboardKeyEventCode;

if (pressedKey == 20)
{
//Do Something
}

pressedKey = 0;


You might be able to check for the hex value directly, but this was so easy, I never tried to work the hex-check out.

Windows Key Codes
https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes

Convert Hex-to-Decimal
https://www.rapidtables.com/convert/number/hex-to-decimal.html
Date Time Of Last Edit: 2023-01-31 22:42:30