Pressing the 0 key while holding control and shift doesn't cause keyPressed to be called

Just as the topic title says, the 0 (zero) key doesn’t seem to cause keyPressed to be called while you’re holding the control and shift keys. It does get called if you press 0 while you’re holding either control or shift but not both, and it does get called if you press other keys while holding control and shift. I tested this in Chrome and Firefox. Is this some key combo that p5 reserves?

There are definitely certain key combinations on certain browsers that either do not fire at all or don’t fire in the normal way (for example on my browser (Brave on Mac OS X) Control+Shift+0 works normally, but Command+0 only fires the first time it is pressed, and Shift+Command+0 doesn’t work at all. The website https://keycode.info/ however, does respond to these keypresses normally, so it must be subscribing to the keyboard events in some other way.

If you are creating a sketch with lots of keybindings it would be wise to detect to OS you are on and select a keyboard shortcut scheme that does not conflict with common OS shortcuts.

2 Likes

Huh, okay, so the browser just kinda doesn’t want me to do that, then. Well, thanks!