I am quite new to javascript, but not to programing in general. What I attempt to do is have the page wait for the user to use a keyboard shortcut, and then proceed to open a popup. A few hours with confusing tutorials leads me to nothing. I’ll re-iterate, this is not asp or other such scripts, this is javascript that it should be written in.
I wish online code example would provide a full, working, ready-to-run source code file from which I can learn more from by looking at instead of text explanations and code snippets.
Keeping in mind my noobishness to this, could you explain what and how this would be done, or better yet, instead give the simplest possible working HTML+js example – a blank page that gives a popup when ctrl+3 is hit for instance. The latter would be far more effective (and probably easier for you than typing out a description) in me figuring this out.
NOTE: Im not trying to do anything complicated, just the basics
Start with:
Now add some
cases. For example, to capture a space you would usecase 32.You can also combine with modifier keys. For example, to capture Ctrl+Space:
Keep adding shortcuts in this way, just be careful not to interfere too much with expected behaviour.