spheredev / neosphere

A lightweight game engine and development platform using JavaScript for game coding, based on the original Sphere engine by Chad Austin but with a redesigned, modern API and brand-new command-line development tools.
http://www.spheredev.org/
Other
108 stars 15 forks source link

Refactor input handling #290

Open fatcerberus opened 6 years ago

fatcerberus commented 6 years ago

Writing the code changes in fe1aee15d87d16473264db45b139e34f10bcd189 made me realize that the current mouse handling logic in input.c is pretty clunky. It assumes a fixed set of mouse buttons, and a mouse wheel that only scrolls vertically. As many modern mice are as complex as gamepads, this code should be refactored to be more flexible.

fatcerberus commented 5 years ago

To be honest, input.c could use to be split off into separate source files for keyboard, mouse and joystick instead of the huge monolithic mess it is now.