Skip to content

Game Controller Scheme

Robert Trzebiński edited this page Sep 24, 2023 · 3 revisions

DevilutionX supports most gamepad controls.

Default controller mappings (A/B/X/Y as in Nintendo layout, so the rightmost button is attack; A ○, B ×, X △, Y □):

  • Left analog or D-Pad: move hero
  • A: attack nearby enemies, talk to townspeople and merchants, pickup/place items in the inventory, OK while in main menu
  • B: select spell, back while in menus
  • X: pickup items, open nearby chests and doors, use item in the inventory
  • Y: cast spell, delete character while in main menu
  • L1: use health item from belt
  • R1: use mana potion from belt
  • L2: character sheet (alt: Start + L1 or ←)
  • R2: inventory (alt: Start + L2 or →)
  • Left analog click: toggle automap (alt: Start + ↓)
  • Start + Select: game menu (alt: Start + ↑)
  • Select + A/B/X/Y: Spell hotkeys
  • Right analog: move automap or simulate mouse
  • Right analog click: left mouse click (alt: Select + L1)
  • Select + Right analog click: right mouse click (alt: Select + R1)
  • Select + L2: quest log (alt: Start + Y)
  • Select + R2: spell book (alt: Start + B)

For now, they can be re-mapped by changing SourceX/controls or by setting the SDL_GAMECONTROLLERCONFIG environment variable (see SDL_GameControllerDB).

[Before v1.5] How to change the default mapping? Case study - update PS5 controller so A ○, B × -> B ○, A × - this will become more natural for PS users.

  1. Plug in your controller, make sure it works in the game. Close the game. Run the game again with --verbose flag in order to see the current controller mapping:
./devilutionx --verbose
(...)
2023-03-24 18:02:02.143 devilutionx[68996:3791527] INFO: Opened game controller with mapping:
030000004c050000e60c000000016800,*,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,touchpad:b15,misc1:b16,platform:Mac OS X
  1. Find out config folder path specific for your OS - you will need to modify diablo.ini file there.

  2. Update diablo.ini with a copy of your current mapping, you can make changes there:

[Controller]
Mapping=030000004c050000e60c000000016800,*,b:b0,a:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,touchpad:b15,misc1:b16,platform:Mac OS X

Note that a:b0,b:b1 was changed to b:b0,a:b1 versus original. You can also make other changes you need.

  1. Restart the game normally, a new mapping should be in use.

[After v1.5] How to change the default mapping? Case study - update PS5 controller so A ○, B × -> B ○, A × - this will become more natural for PS users.

Will likely be the same for PS4.

  1. Find out config folder path specific for your OS - you will need to modify diablo.ini file there.

  2. Update the following section with Play Station controller mapping:

[Padmapping]
(...)
PrimaryAction=A
SecondaryAction=Y
SpellAction=X
CancelAction=B