Commit Graph
9 Commits
Author SHA1 Message Date
Gleb Mazovetskiy b10b4381ef Multiple controllers support (#935) 2020-11-28 22:58:13 +01:00
Gleb Mazovetskiy 693e189025 Controller: Fix L2/R2 handling
Broken in https://github.com/diasurgical/devilutionX/commit/01401a16c70213db7a9a84196dee354a2ebc11a3

`ToControllerButtonEvent` must only be called once per SDL event because
of how it handled L2/R2
2020-11-28 17:58:55 +01:00
Gleb Mazovetskiy 01401a16c7 Fix various controller issues
* Fixes Right Stick cursor movement
* Fixes cursor flicker when moving the cursor while moving the character
* Fixes START + SELECT menu
* Makes SELECT act as Escape in the in-game menu

Fixes #930
2020-11-28 15:02:53 +00:00
Anders Jenbo 8726e80199 Make controller enums C++03 compatible 2020-05-19 17:19:50 +02:00
Anders Jenbo dc8be6c0ab C++03 compatibility (#736)
* Use C++03 compatible constructors
* Remove conflicting definitions
2020-05-17 01:37:19 +02:00
Gleb Mazovetskiy ce5c1007a2 Controller improvements: START modifier and hints
1. Makes START a modifier key.
2. Main modifier actions are now displayed as hints while the modifier is pressed.
3. Mouse simulation now available on all controllers:
   SELECT + D-Pad to move mouse
   SELECT + Left/Right should button to click

 START +    | Action
 ---------- | ------
 SELECT     | Menu
 UP         | Menu
 DOWN       | Map
 LEFT       | Character info
 RIGHT      | Inventory
 B (Bottom) | Spell book
 Y (Left)   | Quest log

This makes all actions available on controllers without sticks and ZL/ZR.
2020-01-25 16:37:50 +01:00
Gleb Mazovetskiy 1bc19ec1e9 Update KbCtrl mappings
New mappings for mouse movement.
Select is now the modifier key.
2019-11-17 23:44:02 +01:00
Gleb Mazovetskiy 6d7014b0a9 Controller: Support SDL1 joystick axes 2019-11-06 02:13:07 +01:00
Gleb Mazovetskiy a2e821d241 Game controller support
Initial game controller support.

Actions are based on the Switch branch but the controller code itself is
implemented differently, allowing for easy remapping and minimizing
changes to the Source/ directory.

Many subtle and not so subtle controller bugs have been fixed
in this implementation, including:

1. Smoother & more responsive movement with the joysticks.
2. Consistent controls for all the menus in the game (stores, quest log,
etc).
3. Cursor appearance / disappearance at appropriate times.

Low-level controls are abstracted and 3 SDL interfaces are supported:
game controller, joystick, and keyboard. See SourceX/controls/ for more
details on this.

Wishlist for the future:

1. Primary button and use button should attack continously.
   This is hard as it requires checking the cooldowns / attack speed.
2. Quick spell menu navigation is very buggy. It is also buggy in the
   switch branch. I haven't had a change to investigate.
2019-11-06 02:13:07 +01:00