Commit graph

1352 commits

Author SHA1 Message Date
Jordan Woyak
31dc3477ad DolphinQt/Mapping: Disable relative input when "Mouse Controlled Pointing" button is pressed. 2024-04-15 14:52:26 -05:00
JosJuice
5456d990d1 Android/ControllerInterface: Run the init code
This was broken by a9a9fdd9e9. Because Init didn't run, the Android
input backend would crash whenever it tried to call into JVM code.
2024-04-13 22:39:10 +02:00
Tilka
e62d8ecfa8
Merge pull request #12632 from jordan-woyak/input-backend-impls
Implement missing InputBackend classes.
2024-04-13 11:56:27 +01:00
Jordan Woyak
e9fe0d3d5b NumericSetting: Stop values from binding to numbered input names. 2024-04-12 15:54:18 -05:00
Jordan Woyak
5039072ae9 ExpressionParser: Support unary plus operator. 2024-04-12 15:52:35 -05:00
mitaclaw
eb92d6f0a8 Core::GetState: Avoid Global System Accessor 2024-04-08 16:23:23 -07:00
Tillmann Karras
d1db347c8a evdev: close file descriptors in a separate thread
For some reason Linux is surprisingly slow at closing file descriptors
of event devices. This commit improves GUI startup times on my computer
by about 1.5 seconds.
2024-04-06 20:58:17 +01:00
OatmealDome
4421cc471d
Merge pull request #12631 from jordan-woyak/remove-osx-input-leftovers
InputCommon: Remove some IOKit leftovers.
2024-04-01 17:05:13 -04:00
Admiral H. Curtiss
6e5f8d6692
Merge pull request #12640 from jordan-woyak/sdl-cleanup
SDL: Cleanups
2024-03-31 06:33:50 +02:00
Jordan Woyak
719d76ab2e GCAdapter: Adjust libusb transfer timeout to 100ms. 2024-03-20 18:02:06 -05:00
Jordan Woyak
3a85725ffa SDL: Remove duplicate button/hat Inputs. Hide duplicate Axis Inputs. 2024-03-14 23:50:17 -05:00
Jordan Woyak
ee43c9508c ControllerInterface: Add IsHidden function to Control interface. 2024-03-14 23:43:58 -05:00
Jordan Woyak
0538366326 SDL: Deduplicate Motor logic with templates. 2024-03-14 23:43:58 -05:00
Jordan Woyak
0fff8374d0 SDL: Move class definition out of header. 2024-03-14 23:43:58 -05:00
Admiral H. Curtiss
617fcc3cf8
WiimoteEmu: Add user-accessible controls that report the desired state of the IR camera objects. 2024-03-11 22:49:19 +01:00
Admiral H. Curtiss
c3903fcc7e
InputCommon/WiimoteController: Add inputs that report the raw IR objects seen by the Wiimote. 2024-03-11 22:46:05 +01:00
Jordan Woyak
a9a9fdd9e9 InputCommon: Add Android InputBackend class. 2024-03-11 03:25:31 -05:00
Jordan Woyak
8583b6751a InputCommon: Handle window change in Quartz. 2024-03-11 03:25:31 -05:00
Jordan Woyak
3665f7abac InputCommon: Implement xlib window change logic. 2024-03-11 03:25:31 -05:00
Jordan Woyak
341f99a3f1 InputCommon: Add Win32 InputBackend class. 2024-03-11 03:25:31 -05:00
Jordan Woyak
2ac59bf581 InputCommon: Add Pipes InputBackend class. 2024-03-11 03:05:52 -05:00
Jordan Woyak
8098be3dfa InputCommon: Add XInput2 InputBackend class. 2024-03-11 03:05:52 -05:00
Jordan Woyak
498584ac77 InputCommon: Add Quartz InputBackend class. 2024-03-11 03:05:52 -05:00
Jordan Woyak
9941c54911 InputCommon: Provide WindowSystemInfo getter for ControllerInterface. 2024-03-11 01:31:05 -05:00
Jordan Woyak
b23dbad098 InputCommon: Remove some IOKit leftovers. 2024-03-11 01:11:13 -05:00
JosJuice
1315b54ffa InputCommon: Use distinct values for profile key
Because the last commit made us use separate folders for GCPad and
GCKey profiles, we should also use separate game INI keys for them.
Otherwise setting e.g. PadProfile1 in a game INI will make both GCPad
and GCKey try to load it, typically with one of them succeeding and the
other one showing a panic alert due to the profile not existing in its
folder.

Better do this breaking change for GCKeys in the same PR as the other
breaking change rather than later.
2024-02-04 17:55:08 +01:00
JosJuice
6cf55ab1ee InputCommon: Unify GetProfileName and GetProfileDirectoryName
After reading the previous commit, you might think "hold on, what's the
difference between GetProfileName and GetProfileDirectoryName"? These
two are being used for the exact same thing - figuring out where
profiles are stored - yet they return different values for certain
controllers like GC keyboards! As far as I can tell, the existing code
has been broken for GC keyboards since they were introduced a decade
ago. The GUI (and more recently, also InputCycler) would write and read
profiles in one location, and our code for loading profiles specified in
a game INI file would read profiles in another location.

This commit gets rid of the set of values used by the game INI code in
favor of the other set. This does breaking existing setups where a
GCKey profile has been configured in a game INI, but I think the number
of working such setups is vanishingly small. The alternative would make
existing GCKey profiles go missing from the profile dropdown in the GUI,
which I think would be more disruptive. The alternative would also force
new GCKey profiles into the same directory as GCPad profiles.

This commit also fixes a regression from d6c0f8e749. The Android GUI was
using GetProfileName to figure out what key to use in the game INI,
which made it use incorrect game INI entries for GameCube controller
profiles but not Wii Remote profiles. Now the Android GUI uses
GetProfileKey for this, fixing the problem.
2024-02-04 17:55:08 +01:00
JosJuice
2bcf70af3f InputCommon: Refactor away InputConfig::LoadConfig's switch case
By having getters for this information, other code that needs access to
the same information can call the getters instead of duplicating the
information.
2024-02-04 16:46:10 +01:00
Admiral H. Curtiss
83d4b692b8
InputCommon/WGInput: Handle add/remove events on separate thread to prevent deadlocks.
In particular this is triggered when running Dolphin with the Steam overlay.
2024-01-18 00:30:45 +01:00
Admiral H. Curtiss
c7d7ae4912
InputCommon/SDL: Code style fixes. 2024-01-15 15:19:41 +01:00
Admiral H. Curtiss
5e6e61c723
InputCommon/SDL: Avoid potential infinite loops from integer truncation. 2024-01-15 15:19:24 +01:00
Admiral H. Curtiss
d657ad5932
InputCommon/SDL: Check for errors from SDL_JoystickNumButtons(), SDL_JoystickNumAxes(), SDL_JoystickNumHats(). 2024-01-15 15:18:38 +01:00
Admiral H. Curtiss
959c39133b
InputCommon/SDL: Fix incorrect use of std::vector::assign() and check bounds. 2024-01-15 15:17:32 +01:00
Admiral H. Curtiss
1cca3b24c6
Merge pull request #12085 from SuperSamus/sdl-gamecontroller
SDL: Add GameController API, cleanup
2024-01-13 16:37:43 +01:00
Martino Fontana
51e05f468a SDL: Add GameController API, cleanup 2024-01-13 16:10:25 +01:00
Vicki Pfau
a8033f164b Steam Deck: Pad out feature report to 64 bytes
Also update the names of the setting post-Steam Deck commits to SDL

Fixes https://bugs.dolphin-emu.org/issues/13412
2024-01-10 19:49:52 -08:00
Martino Fontana
0ab2bc2287 ControllerInterface: Make FullAnalogSurface inherit IsDetectable() 2024-01-10 12:20:07 +01:00
Admiral H. Curtiss
07c035e659
Core/SystemTimers: Refactor to class, move to System. 2024-01-04 23:35:19 +01:00
Filoppi
e456bef163 Input: Improve Controller Interface devices threading
This specific issue was already addressed by https://github.com/dolphin-emu/dolphin/pull/11635
though I felt like there was something more we could do, and wasn't too happy with the
likelihood of devices update calls being skipped (due to `m_devices_population_mutex` being locked).
2023-12-18 21:45:22 +02:00
Tilka
8cbb2c2e44
Merge pull request #12399 from lioncash/erasing
General: Make use of std::erase_if/std::erase where applicable
2023-12-12 20:54:52 +00:00
Lioncash
ded2d55438 ExpressionParser: Avoid some miscellaneous copies
Just some trivial copies that can be eliminated or turned into moves.
2023-12-12 14:03:41 -05:00
Lioncash
a5bbeb721a ExpressionParser: Mark constructors explicit where applicable
Makes for consistency with the surrounding code.
2023-12-12 14:00:27 -05:00
Lioncash
ea71a76ea9 ExpressionParser: Pass control qualifiers by const reference
These aren't necessarily cheap to copy, since a control qualifier will
have around 3 std::strings inside of it, so passing by value can churn
allocations a little bit.
2023-12-12 13:50:46 -05:00
Lioncash
9aea481e59 ExpressionParser: Make use of std::erase_if 2023-12-12 13:31:58 -05:00
Lioncash
196f8e5123 MappingCommon: Make use of std::erase_if 2023-12-12 13:31:18 -05:00
Mai
ac53766058
Merge pull request #12215 from JosJuice/android-si-devices
Android: Add more GameCube controller types
2023-11-28 19:21:29 +01:00
Dentomologist
2d3bae9c79 SDL: Add default case to switch statement
Fix -WSwitch warning about unhandled enum value SDL_NUM_LOG_PRIORITIES.

log_level is initialized to LNOTICE right before the switch statement so
this doesn't cause any behavior changes.
2023-11-10 12:05:20 -08:00
Jordan Woyak
30ce1f2ec2 ControllerInterface/SDL: Remove Xbox 360 controller disabling hack. 2023-10-26 18:04:11 -05:00
JosJuice
d6c0f8e749 Android: Get profile name from core
To avoid duplicating information between Kotlin and C++.
2023-10-01 18:47:49 +02:00
Admiral H. Curtiss
53df01f7d8
Merge pull request #12172 from ArcaneNibble/sd
Steam Deck: Periodically reenable gyro
2023-09-28 04:10:27 +02:00