Commit Graph

75 Commits

Author SHA1 Message Date
Léo Lam e2c769a9c5
Merge pull request #7992 from artemist/centering
ControllerEmu: Add support for setting the center of a ReshapableInput
2019-05-20 18:29:31 +02:00
Artemis Tosini 49e46c8aff
ControllerEmu: Add support for setting the center of a ReshapableInput
This is useful in far out-of-calibration controllers, such as the
Switch Pro controller. This also adds support for configuring the center
in the Mapping widget.
2019-05-18 14:45:16 +00:00
spycrab ec734065db
Merge pull request #8087 from spycrab/cmake_win2019
Support CMake on Windows
2019-05-14 21:07:26 +02:00
Jordan Woyak 374585f128 WiimoteEmu/DolphinQt: Rename "IR" to "Point" and eliminate redundant Forward/Backward mappings. 2019-05-08 20:27:41 -05:00
spycrab 12a26453e9 InputCommon/ControlGroup.h: Add missing include 2019-05-08 21:03:11 +02:00
Léo Lam ab9ece9bca Replace MathUtil::Clamp with std::clamp 2019-05-04 23:12:17 +02:00
Jordan Woyak 99f537d499 WiimoteEmu/DolphinQt: Better extension display names. 2019-05-01 17:25:48 -05:00
Jordan Woyak 57a23cc4a0 InputCommon: Remove unused "sign" macro. 2019-04-29 18:28:56 -05:00
Jordan Woyak 9f0dc402f4 InputCommon: Make sure setting values are initialized in case they are used before config load. 2019-04-27 07:01:24 -05:00
Jordan Woyak ba1b335118 WiimoteEmu: Improve emulated swing. 2019-04-23 19:02:41 -05:00
Jordan Woyak 4374600367 WiimoteEmu: Implement MotionPlus parameter y0 and other cleanups. 2019-04-23 18:38:00 -05:00
JMC47 80d21b8ffb
Merge pull request #8002 from JMC47/CursorSlowdown
Slow down relative input cursor
2019-04-15 20:43:31 -04:00
JMC47 f3aaf5deaa Reduce Relative Input Cursor Speed Dramatically
This makes it about 1/4th the speed which may be a bit slow, but should
work for most controllers.
2019-04-15 17:23:17 -04:00
Jordan Woyak c89ddf8cba WiimoteEmu: Allow shake frequency and intensity to be configured. Other minor cleanups. 2019-04-12 16:50:59 -05:00
Jordan Woyak 5efb717873 InputCommon: Clean up how numeric settings are handled. Add units of measure to UI. Eliminate hidden magic values of the IR cursor. 2019-04-07 09:32:49 -05:00
Tilka a865cc0bf6
Merge pull request #7806 from jordan-woyak/wiimote-emu-swing-improve
WiimoteEmu: Reimplement tilt/swing/camera/orientation data using matrix math.
2019-03-05 23:37:00 +00:00
Jordan Woyak 4db4840d7c WiimoteEmu: Reimplement tilt/swing/camera/orientation data using matrix math. 2019-03-03 12:43:25 -06:00
Jordan Woyak ecb67cf815 ControllerEmu: Deadzone math fix. 2019-03-01 17:40:10 -06:00
Jordan Woyak 0064f70c8a DolphinQt/ControllerEmu: Replace Input Radius/Shape settings with an input calibration "wizard". 2019-02-10 07:55:47 -06:00
Jordan Woyak 9c1a8891e5 WiimoteEmu: Code cleanups. 2019-02-02 19:40:31 -06:00
Jordan Woyak 0d1fbe7bbc WiimoteEmu: Major renaming and cleanup. 2019-02-02 19:40:31 -06:00
Jordan Woyak 3bc4968c11 ControllerEmu: Round input floats instead of casting to prevent almost-neutral values from being rounded down. 2019-02-02 15:12:07 -06:00
Léo Lam e19ee2ad4f
Merge pull request #7664 from jordan-woyak/kill-button-threshold
ControllerEmu: Killed the button group threshold setting.
2019-01-16 21:33:05 +01:00
Jordan Woyak df43fd9472 ControllerEmu: Killed the Buttons group threshold setting. 2018-12-31 08:35:31 -06:00
Jordan Woyak 7efa96eda9 ControllerEmu: code cleanup. 2018-12-30 10:52:45 -06:00
Jordan Woyak 7a00f55cfa ControllerEmu::Cursor: Add input radius/shape settings to IR Cursor mappings to allow use of round inputs in absolute mode. Make relative input option obey the center/width/height settings. Make the mapping indicator pretty and actually show what the relative/center/w/h settings are doing. 2018-12-30 09:10:32 -06:00
Jordan Woyak 247fa8c628 WiimoteEmu: Remove redundant threshold setting from hotkeys button group. 2018-12-29 16:19:28 -06:00
Jordan Woyak c3dc3c106c ControllerEmu: Reorganize stick reshaping code and use it for emu wiimote tilt as well. Also make the tilt mapping indicator pretty. 2018-12-29 16:06:03 -06:00
Jordan Woyak 6a6195f53c ControllerEmu: Implement dead zone setting for triggers. 2018-12-29 13:56:35 -06:00
Jordan Woyak c614f5f534 ControllerEmu: Allow analog stick input radius greater than one. Useful for rounded-square inputs of xbox controllers. 2018-12-27 19:16:37 -06:00
Jordan Woyak da9bcf83ef InputCommon: Simplified StickGate interface and moved class into its own file. Changed default input radius to perform no resizing. Tweaked the indicator colors a bit to improve visibility. Cleaned up some math and code. 2018-12-27 18:31:46 -06:00
Jordan Woyak ceb28a2302 Add ability to reshape analog sticks from square/circle to octagon and make the analog stick mapping indicator pretty. 2018-12-27 18:31:46 -06:00
Lioncash cfe7549091 ControlGroup/Triggers: Return state data by value
Makes it less error-prone to get state data from analog sticks (no need
to pass any locals), and also allows direct assignment, letting the
retrieved data be const.
2018-07-13 13:20:35 -04:00
Lioncash 97ba02df27 ControlGroup/Tilt: Return state data by value
Makes it less error-prone to get state data from tilt controls (no need
to pass any pointers to locals), and also allows direct assignment,
letting the retrieved data be const.
2018-07-13 13:20:35 -04:00
Lioncash 918d448b5b ControlGroup/Slider: Return state data by value
Makes it less error-prone to get state data from sliders (no need
to pass any locals), and also allows direct assignment, letting the
retrieved data be const.
2018-07-13 13:20:35 -04:00
Lioncash 4c30b9e14d ControlGroup/Force: Return state data by value
Ensures that an array of sufficient size is always used and doesn't put
the responsibility on the caller. It also allows for direct assignment.
2018-07-13 13:20:35 -04:00
Lioncash ef1240b0c7 ControlGroup/Cursor: Return state data by value
Makes it less error-prone to get state data from cursors (no need
to pass any pointers to locals), and also allows direct assignment,
letting the retrieved data be const.
2018-07-13 13:20:35 -04:00
Lioncash d05f490caa ControlGroup/AnalogStick: Return state data by value
Makes it less error-prone to get state data from analog sticks (no need
to pass any locals), and also allows direct assignment, letting the
retrieved data be const.
2018-07-13 13:20:31 -04:00
iwubcode 9f9afeb63e Wiimote Emulation: Be able to trigger swings consistently by holding down buttons. This makes certain actions easier (tested with Red Steel) 2018-07-07 00:49:47 -05:00
spycrab c7c93a8e80 ControllerEmu/BooleanSetting: Add exclusive flag 2018-07-02 15:15:23 +02:00
robopilot99 ab02499ce7 Add auto-hide option to Wii IR pointer 2018-06-04 17:58:21 -05:00
JosJuice 7ed28297b2 ControllerEmu: Use enum instead of bool for translatability 2018-04-13 13:04:26 +02:00
JosJuice 3f13dbe087 Translate certain button names but not all
Some button names should be translated, for instance Up, Left and such.
At the same time, some other button names shouldn't be translated,
for reasons that might be less obvious. In 0146456af, I removed the
_trans markers for button names that never need to be translated
(such as A and B), but that isn't actually enough to ensure that
DolphinWX won't try to translate them anyway. This commit adds a bool
that explicitly tells the GUI whether a button name should be translated.
Otherwise we'll have problems like the GUI treating the button name "B"
(which isn't supposed to be translated) as matching the translatable
string "B" (being an abbreviation of "bytes"), meaning that the button
"B" will be labeled "o" when running Dolphin in French (after
translations get pulled from Transifex the next time).

By the way, while it turned out that DolphinWX translated all button
names, it also turned out that DolphinQt2 translated *no* button names.
Go figure. This commit makes them consistent with each other.
2018-04-13 13:04:26 +02:00
Emmanuel Gil Peyrot f5dc8e7737 Rename constructor parameters to avoid shadowing members 2017-12-19 12:05:06 +01:00
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
Michael M 1b1dd1d749 EmulatedController: encapsulate default device behind getters/setters 2017-11-04 17:08:55 -07:00
Michael M 31f1c06226 ControlReference: don't reparse expression when references are updated 2017-09-14 12:53:35 -07:00
JosJuice 960525859b Make DolphinWX strings more like DolphinQt2 strings
Same as the previous commit, except I'm copying strings
in the other direction because the DolphinWX variants
of these strings could use some improvement.
2017-07-26 08:04:10 +02:00
JosJuice 0146456af0 Don't translate button names
Since these button names are printed on all real controllers,
we should show them in the same way as they are printed on
the controllers, regardless of the user's language. It seems
like this was intended all along (except for "Start"), but the
_ markers in TASInputDlg.cpp (accidentally?) led to the button
names in the controller configs also becoming translatable.

I'm making exceptions for "L" and "R" because translators
may want to mark them in some way (for instance "L-Digital")
to clarify the difference from "L-Analog" and "R-Analog".

I'm also making an exception for START/PAUSE because it's
referred to as スタート in Japanese games.

I'm changing "Home" and "Start" to uppercase for consistency
with how Nintendo refers to those buttons, and because someone
who isn't familiar with the Latin script might not know the
connection between the lowercase and uppercase letters (most
users likely do know the connection, but we shouldn't assume it),
and because leaving "Start" as "Start" makes it "collide" with
unrelated strings, such as the string for the button that starts
a netplay session.

To rename "Start" and "Home" without breaking INI
compatibility, I added a ui_name variable like in f5c82ad.
2017-05-06 16:29:10 +02:00
Anthony dc4f8dd70b Merge pull request #5345 from JosJuice/consistent-controller-translation
Use _trans consistently for controllers
2017-05-04 09:00:41 -07:00