dolphin/Source/Core/InputCommon
Michael Maltese c62d83a34b GCPadEmu: only connected if default device connected
This lets Dolphin know if a configured GameCube Controller should actually
be treated as connected or not.

Talked to @JMC47 a bit about this last night. My use-case is that all of
my controllers are the same hardware (Xbox One controllers) so share the
same configuration (modulo device number). Treating them all as always
connected isn't a problem for most games, but in some (Smash Bros.) it
forces me to go find a keyboard/mouse and unconfigure any controllers
that I don't actually have connected. Hotplugging devices (works on macOS,
at least) + this patch remove my need to ever touch the Controller Config
dialog while in a game.

This patch makes the following changes:

- A new `BooleanSetting` in `GCPadEmu` called "Always Connected", which
  defaults to false.
- `ControllerEmu` tracks whether the default device is connected on every
  call to `UpdateReferences()`.
- `GCPadEmu.GetStatus()` now sets err bit to `PAD_ERR_NO_CONTROLLER` if
  the default device isn't connected.
- `SIDevice_GCController` handles `PAD_ERR_NO_CONTROLLER` by imitating the
  behaviour of `SIDevice_Null` (as far as I can tell, this is the only use
  of the error bit from `GCPadStatus`).

I wanted to add an OSD message akin to the ones when Wiimotes get
connected/disconnected, but I haven't yet found where to put the logic.
2017-11-19 16:07:00 +01:00
..
ControlReference ExpressionParser: std::move() tokens vector to parser 2017-09-14 12:53:36 -07:00
ControllerEmu GCPadEmu: only connected if default device connected 2017-11-19 16:07:00 +01:00
ControllerInterface GCPadEmu: only connected if default device connected 2017-11-19 16:07:00 +01:00
CMakeLists.txt Depreciate old OSX Keyboard and Mouse 2017-08-21 01:44:03 -04:00
GCAdapter.cpp Add Core::State::Starting 2017-09-13 17:30:18 -07:00
GCAdapter.h GCAdapter: Return input state by value 2016-08-01 21:27:51 -04:00
GCAdapter_Android.cpp Add Core::State::Starting 2017-09-13 17:30:18 -07:00
GCPadStatus.h Add GCPadStatus.isConnected boolean 2017-11-19 16:01:08 +01:00
InputCommon.vcxproj upgrade to Windows SDK 10.0.15063.0 2017-05-28 13:37:31 +02:00
InputCommon.vcxproj.filters might as well update yet some more pointless version numbers.. 2017-06-03 18:20:40 -07:00
InputConfig.cpp EmulatedController: encapsulate default device behind getters/setters 2017-11-04 17:08:55 -07:00
InputConfig.h ControllerEmu: Separate ControlGroup from ControllerEmu 2017-02-09 18:18:52 -05:00
KeyboardStatus.h Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00