You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KeyboardEvent.key is good for somewhere where you need to type, and a is not same as A, but for something interactive - as games / visual interactive applications - better use KeyboardEvent.code - as for games - more important is position of button instead of it typing value.
Other critical part is when you would like (and most of gamers prefer) use WASD (ZQSD on AZERTY) fro player control, and that not matters what keyboard they use, other part if i would like use Shift key in combination with all that stuff, that would ruin all logic what im doing as it will require much more validations..
total off topic but you can save few renders with improving keyDown event:
(D.field "key" D.string
|> D.andThen
(\k ->
if Set.member k computer.keyboard.keys then
D.fail ""
else
D.succeed (KeyChanged True k)
)
)```
that will not trigger non-renderable frame few times while player holds key (as it is sends keydown event few times in sec)
The text was updated successfully, but these errors were encountered:
KeyboardEvent.key
is good for somewhere where you need to type, anda
is not same asA
, but for something interactive - as games / visual interactive applications - better useKeyboardEvent.code
- as for games - more important is position of button instead of it typing value.Other critical part is when you would like (and most of gamers prefer) use WASD (ZQSD on AZERTY) fro player control, and that not matters what keyboard they use, other part if i would like use Shift key in combination with all that stuff, that would ruin all logic what im doing as it will require much more validations..
total off topic but you can save few renders with improving keyDown event:
The text was updated successfully, but these errors were encountered: