Skip to content

Instantly share code, notes, and snippets.

@maroider
Last active September 10, 2020 18:56
Show Gist options
  • Save maroider/c53f88e4a46c1864ab32bf353b22e455 to your computer and use it in GitHub Desktop.
Save maroider/c53f88e4a46c1864ab32bf353b22e455 to your computer and use it in GitHub Desktop.
Fun windows keyboard events

Event log key

[P]: Key Pressed

[R]: Key Released

Device(_, _): Device event

Window(_, _): Window event

{Device|Window}(x, y): x is vkey, y is scancode

Print Screen

[P] PrtScn: Device(0xFF, 0xE02A), Device(0x2C, 0xE037)
[R] PrtScn: Device(0x2C, 0xE037), Window(0x2C, 0xE037), Device(0xFF, 0xE02A)

[P] Ctrl+PrtScn: Device(0x2C, 0xE037)
[R] Ctrl+PrtScn: Device(0x2C, 0xE037), Window(0x2C, 0xE037)

[P] Alt+PrtScn: Device(0x2C, 0x54)
[R] Alt+PrtScn: Device(0x2C, 0x54), Window(0x2C, 0x54)

[P] Ctrl+Alt+PrtScn: Device(0x2C, 0x54)
[R] Ctrl+Alt+PrtScn: Device(0x2C, 0x54), Window(0x2C, 0x54)

Scroll lock

// Scroll lock Off

[P] ScrollLock: Device(0x91, 0x46), Window(0x91, 0x46)
[R] ScrollLock: Device(0x91, 0x46), Window(0x91, 0x46)

// Scroll lock On

[P] ScrollLock: Device(0x91, 0x46), Window(0x91, 0x46)
[R] ScrollLock: Device(0x91, 0x46), Window(0x91, 0x46)

// Scroll lock Off

// NOTE: This is the only combination which produces different events
[P] Ctrl+ScrollLock: Device(0x3, 0x46), Window(0x3, 0x46)
[R] Ctrl+ScrollLock: Device(0x3, 0x46), Window(0x3, 0x46)

// Scroll lock Off

[P] Alt+ScrollLock: Device(0x91, 0x46), Window(0x3, 0x46)
[R] Alt+ScrollLock: Device(0x91, 0x46), Window(0x3, 0x46)

// Scroll lock On

[P] Alt+ScrollLock: Device(0x91, 0x46), Window(0x3, 0x46)
[R] Alt+ScrollLock: Device(0x91, 0x46), Window(0x3, 0x46)

// Scroll lock Off

[P] Ctrl+Alt+ScrollLock: Device(0x91, 0x46), Window(0x3, 0x46)
[R] Ctrl+Alt+ScrollLock: Device(0x91, 0x46), Window(0x3, 0x46)

// Scroll lock On

[P] Ctrl+Alt+ScrollLock: Device(0x91, 0x46), Window(0x3, 0x46)
[R] Ctrl+Alt+ScrollLock: Device(0x91, 0x46), Window(0x3, 0x46)

Pause/Break

[P] Pause/Break: Device(0x13, 0xE01D), Window(0x13, 0x45), Device(0xFF, 0x45)
[R] Pause/Break: Device(0x13, 0xE01D), Window(0x13, 0x45), Device(0xFF, 0x45)

[P] Ctrl+Pause/Break: Device(0x3, 0xE046), Window(0x3, 0xE046)
[R] Ctrl+Pause/Break: Device(0x3, 0xE046), Window(0x3, 0xE046)

[P] Alt+Pause/Break: Device(0x13, 0xE01D), Window(0x13, 0x45), Device(0xFF, 0x45)
[R] Alt+Pause/Break: Device(0x13, 0xE01D), Window(0x13, 0x45), Device(0xFF, 0x45)

[P] Ctrl+Alt+Pause/Break: Device(0x3, 0xE046), Window(0x3, 0xE046)
[R] Ctrl+Alt+Pause/Break: Device(0x3, 0xE046), Window(0x3, 0xE046)

NumLock

// NumLock Off

[P] NumLock: Device(0x90, 0x45), Window(0x90, 0xE045)
[R] NumLock: Device(0x90, 0x45), Window(0x90, 0xE045)

// NumLock On

[P] NumLock: Device(0x90, 0x45), Window(0x90, 0xE045)
[R] NumLock: Device(0x90, 0x45), Window(0x90, 0xE045)

// NumLock Off

// NOTE: This is the only combination which produces different events
[P] Ctrl+NumLock: Device(0x13, 0x45), Window(0x13, 0xE045)
[R] Ctrl+NumLock: Device(0x13, 0x45), Window(0x13, 0xE045)

// NumLock Off

[P] Alt+NumLock: Device(0x90, 0x45), Window(0x90, 0xE045)
[R] Alt+NumLock: Device(0x90, 0x45), Window(0x90, 0xE045)

// NumLock On

[P] Alt+NumLock: Device(0x90, 0x45), Window(0x90, 0xE045)
[R] Alt+NumLock: Device(0x90, 0x45), Window(0x90, 0xE045)

// NumLock Off

[P] Ctrl+Alt+NumLock: Device(0x90, 0x45), Window(0x90, 0xE045)
[R] Ctrl+Alt+NumLock: Device(0x90, 0x45), Window(0x90, 0xE045)

// NumLock On

[P] Ctrl+Alt+NumLock: Device(0x90, 0x45), Window(0x90, 0xE045)
[R] Ctrl+Alt+NumLock: Device(0x90, 0x45), Window(0x90, 0xE045)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment