Used to check if a JavaScript key code is currently toggled.

Use a website like to determine different key values.

If the key is toggled on it would be true.

Returns a boolean. (true / false)


alt.isKeyToggled(key: number): boolean


alt.isKeyToggled(20); // Caps Lock

Real World Example

const result = alt.isKeyToggled(20); // Caps Lock

if (result) {
    console.log(`Caps Lock is Enabled!`);
} else {
    console.log(`Caps Lock is Not Enabled`);

These examples assume you have imported alt from alt-client.

results matching ""

    No results matching ""