scottschiller / ArmorAlley

A browser-based interpretation of Armor Alley, a combat strategy game originally released in 1990 for the Macintosh and MS-DOS PCs.
https://armor-alley.net/
Other
91 stars 25 forks source link

Z key in Firefox opens Quickfind bar #17

Closed artfoundry closed 5 months ago

artfoundry commented 5 months ago

While playing, pressing Z opens the Quickfind bar at the bottom of the window (normally only the forward slash key is supposed to open Quickfind). I wasn't able to find any info online about the Z key supposed to be doing this, so I'm guessing you're doing something with the key mapping that's causing Z to fire off the same signal as '/' in FF?

scottschiller commented 5 months ago

Huh! I am not able to repro this in Firefox on Mac with Z, in AA - but the slash key / does trigger it for me as expected. I don't think my keypress event listeners are doing anything out of the ordinary.

Does Z happen to do this on other sites for you in Firefox, when the cursor isn't focused on a text field / form input, etc.?

artfoundry commented 5 months ago

Ok yeah my bad. It's an option in FF (which I never use) that you can start typing (any key, not just Z), and the Quickfind bar will open. Fortunately you can disable it in Settings -> General -> Browsing ("Search for text when you start typing")

scottschiller commented 5 months ago

Ah-ha, thanks for confirming. I'll mark this resolved. Keyboard stuff is a bit of a minefield, I try to be really careful about which keys are "safe" in terms of availability and support. Thankfully, I only have shift for the gunfire and ctrl by themselves for bombs. Any time you add a modifier like shift / alt / ctrl or meta / apple along with some other character key, "here be dragons." ;)