2

This is a pretty straight forward question with an answer that seems very difficult to track down.

Why is there no keydown event for printscreen in javascript?

I tried to look through some of the source code for firefox to see if it handled VK_SNAPSHOT differently on purpose, to make it not catchable by design, but I did not find anything.

This seems to go pretty far down the Windows OS stack as C# also shares this problem (KeyDown event not Working on PrintScreen Key) This answer mentions that "printscreen is trapped by the OS", but does not provide any documentation for that statement. I tried to google around still was unable to find any supporting documentation.

Is the printscreen keydown event processed directly by the kernel and never hits user land similar to the Ctrl-alt-delete interrupt? Does this happen in the keyboard driver and a different keyboard driver might pass it up the stack to javascript? Am I way off base and javascript can catch the keydown event and this question now looks really stupid?

(As an aside while trying to find the answer to this I came across this neat article that taught me a little about the history of the SysRq button - http://royal.pingdom.com/2012/06/26/sysadmin-needs-sysrq-magic/)


List of links of questions with "I don't know why but..."

KeyDown event not Working on PrintScreen Key c#

https://gamedev.stackexchange.com/questions/20446/does-vk-snapshot-not-send-a-wm-keydown-only-wm-keyup C-ish language?

Detect Print Screen keyup and keydown in Keyboard Tester app VB NET VB.NET

Community
  • 1
  • 1
Scott
  • 12,077
  • 4
  • 27
  • 48
  • Seems to be a problem of windows, happens on java as well: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4455060 . Seems only way would be to capture keyup – juvian Jun 06 '16 at 18:47
  • @juvian, I agree that this seems to be in the windows stack, but usually its possible to find documentation about these things. I am just curious where in the windows stack this is happening. As far as I remember, ctrl-alt-del is the only kernel level non-user-mode keyboard command. If there are more, I would love to learn about them. – Scott Jun 06 '16 at 18:50
  • Couldn´t find anything, but it seems you can capture it in some languages by overriding how key events are handled: http://stackoverflow.com/questions/24325511/detect-print-screen-keyup-and-keydown-in-keyboard-tester-app-vb-net – juvian Jun 06 '16 at 19:16

0 Answers0