I'm sometime modding with a laptop and I don't use the mouse in that case (I don't really need it and it is not very laptop-ish). Testing with the trackpad is still uncomfortable so I started to dig in the code to add keyboard input to run the game without mouse nor gamepad, like in the early 90's.
This is my first change is the engine. My commits are there before everything is set to create a pull request:
- Add look up/down/left/right keyboard inputs (default with the arrows)
- Add gui entries in the keymap screen
- Add keyboard look sensitivity in options (horizontal and vertical)
- Add en entry in the graphical advanced configuration for look sensitivity
- What to do with the input bitmask? (look is currently added to it, but is unreliable because keyboard only)
- Translations (I can't do them outside one or two…)
- Add a keyboard alias for LBM and RBM in game
Without LBM and RBM aliases it may be usefull only for laptops to still use the buttons on the trackpad but not the trackpad itself.
But defining a keyboard alias is too much of a hassle because of conflicts in inputs with mouse and joystick and the fact that key pressed event is repeated while the key is hold down. Using a few workaround would make some ugly code. The repetition is still fine for a few inputs (like volume up and down), but not for the rest and it could be applied to the mouse too.
I feel it would be better to merge all inputs and abstract them and allow to map any mouse button to any action instead of looking directly at mouse button state + keyboard commands (not keys) + joystick button state. This is far more than the scope of the initial task but it also opens to mouse button remapping and even alternative keys (two key assignments like keypad + numbers).
I first need to write a blueprint of how inputs could be handled before diving into the code again.