airmash-refugees / airmash-frontend

"Semi-pristine" copy of last official Airmash app
https://airmash.online
43 stars 24 forks source link

Special ability disabled when chat typing is open? #23

Open peace2000 opened 4 years ago

peace2000 commented 4 years ago

Hi! Can you enable the use of special ability when the chat typing window is open?

I don't see any point why special abilities should be disabled when your typing window is open. If someone attacks me when typing, I will have to send it as unfinished or remove it completely (takes time), before I can use my special abilities again.

congratulatio commented 4 years ago

This could be done, but I think it would have to be a configurable option, as both the Ctrl and Shift keys are used when typing certain characters. For example Ctrl + Alt + e will type the é character in some input locales.

Another alternative in the meantime is to remap your key bindings (by pressing K in the game) so you have a special key that's not captured by the chatbox.

The keys this applies to are: Tab, Up, Down, Left, Right, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, Escape and Enter.

Escape and Enter are reserved for chat box interaction, and I expect you'll want to keep Up, Down, Left and Right for movement, but you have Tab (normally mapped to showing the scoreboard) and the function keys available to map to one of your special keys, should you wish to experiment with this.

congratulatio commented 4 years ago

Also just to make a note of the code responsible for this:

https://github.com/airmash-refugees/airmash-frontend/blob/b5c8685f926025c9ea4b02b0c67d1e5f0ca9ff28/src/js/Input.js#L254-L256

This checks the keycodes for all the keys listed in my previous comment.