Open Bug 997534 Opened 9 years ago Updated 9 years ago

Polling API for the keyboard and mouse state

Categories

(Firefox :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

()

People

(Reporter: lstowasser, Unassigned)

Details

(Whiteboard: [games:p?])

Polling API for the keyboard and mouse (e.g. isKeyDown(keycode)).

We can maintain our own key and mouse state by listening to event handlers, but its a huge pain. We have to be very careful to reset state when the window loses focus, or else keys can get "stuck" in the down state because we never observe the key up event. This is less of an issue with "real" full-screen, but if the player wants to play in windowed mode, we still need to cope with this sort of stuff. We've fixed the obvious problems (e.g. reset state in the 'blur' and 'focus' events), but we keep encountering weird edge cases where we miss an event. We'll fix all of these bugs eventually, but a polling API would make things a lot easier.
Whiteboard: [games:p?]
You need to log in before you can comment on or make changes to this bug.