Inputs

Gamepad Mapping

This section should aboard these different problems:

  • mapping a physical gamepad to some standard gamepad
  • mapping the standard gamepad to some non standard gamepad or another kind of input
  • mapping a physical gamepad to some non standard gamepad or another kind of input
  • showing to the user which physical button correspond to which target input

Ports and Players

This section should aboard these different how inputs are assigned to an emulated consol port or a player.

The problem: emulators have ports which can accept one or no gamepad, and controllers can be plugged into one or no port, we want the user to be able to reassign the controllers to the ports. Ports roughly map to players as typically there is one controller per player, though in rare cases a controller could be shared by multiple players and multiple controllers could can be used by one player.

Following is a proposal to fix this problem.

When starting a game, each gamepad should be assigned to a port (gamepad one to port one… etc.).

A button showing a gamepad icon should be on the right part of the header bar, clicking it would display a popover containing the following:

  • a list of the controllers showing:
    • an icon describing the type of the controller
    • the controller's name
    • the port (player?) number it is assigned to or "Unassigned"
    • optionally a button to tweak the how the controller is used:
      • change the mapping from the standard gamepad to the emulated gamepad (use the "west" and "south" buttons instead of "south" and "east" for 2-buttons controllers, …)
      • use the mouse as a lightgun
      • use the keyboard as a gamepad
  • a "Reassign" button

Clicking the reassign button would trigger a dialog showing the list of all controllers as "Unassigned", the dialog would ask "Press a button on controller for port (player?) x, then x+1, etc… until all controllers are assigned or the process is validated early, making the remaining controllers unassigned. A button could allow to skip a port, another could allow to assign the mouse.

The following tweaks could be possible in the popover:

  • change the mapping from the standard gamepad to the emulated gamepad (cardinal points are used as gamepad button position):
    • use the W and S buttons instead of S and E for 2-buttons controllers
    • use the N, W and S buttons instead of W, S and E for 3-buttons controllers
  • use the mouse as a lightgun
  • use the keyboard as a gamepad

This section should aboard how the GUI could be controlled with other inputs than a keyboard and a mouse, such as gamepads. This would avoid the player to switch between different input types when using Games.

Accessing Gamepads

There are two APIs provided by the linux kernel:

Other references:

Resources

Relevant Art

OpenEmu

openemu1.png

Concepts

ingametitlebar-1.png customizefirstpage-1.png customizesecondpage-1.png customizesecondpagekeyboard-1.png customizebyclicking-1.png incompatibleprompt-1.png

Design/Playground/Games/Inputs (last edited 2017-05-08 12:22:51 by AdrienPlazas)