Commit Graph

1372 Commits

Author SHA1 Message Date
mitaclaw
9bd1dae41d Modernize std::fill with ranges
In DSPCore.cpp, there were two `std::fill` uses that could be simplified using `std::fill_n`. Due to their proximity with other `std::fill` algorithms being modernized with ranges, I chose to make these examples into the rare `std::ranges::fill_n`.
2024-10-10 00:53:48 -07:00
mitaclaw
249defa72b Modernize std::equal with ranges 2024-10-10 00:53:48 -07:00
mitaclaw
4cc5e1972a Modernize std::count_if with ranges 2024-10-10 00:53:48 -07:00
mitaclaw
5f90673686 StringUtil: Remove JoinStrings
With 12 uses of `JoinStrings` in the codebase vs 36 uses of `fmt::join`, fmtlib's range adapter for string concatenation with delimiters is clearly the preferred option.
2024-09-22 21:09:36 -07:00
Dr. Dystopia
9602f36248 Remove redundant semicolons 2024-08-20 14:59:54 +02:00
mitaclaw
de1c47a701 Misc. Container Find Changes 2024-08-15 14:25:51 -07:00
mitaclaw
9fa4eb9aab Use 'contains' method 2024-08-15 14:20:16 -07:00
Dr. Dystopia
618b41a459 Use 'contains' method 2024-08-14 22:18:28 +02:00
Tilka
603c8fad85
Merge pull request #12961 from JosJuice/expression-parser-translation
InputCommon: Translate ExpressionParser error messages
2024-08-07 03:28:48 +01:00
JosJuice
defc38b258 InputCommon: Translate ExpressionParser error messages
The _trans macro marks strings for translation but doesn't do anything
at runtime. For that, we need to use a function like GetStringT.
2024-07-28 12:09:15 +02:00
Dentomologist
d627b78c46 Adjust order and spacing of various #includes
Move some #includes around to match the Contributing guidelines.
2024-07-26 14:28:34 -07:00
Tillmann Karras
982893b04c Use C++20 erase_if() instead of erase(remove_if()) (NFC) 2024-07-21 16:36:06 +01:00
Admiral H. Curtiss
ed4a09fa56
Merge pull request #12850 from jordan-woyak/device-sorting
ControllerInterface: Adjust sort priorities to ensure default keyboard-mouse device is first.
2024-06-15 21:12:08 +02:00
Jordan Woyak
42e73547eb ControllerInterface: Adjust sort priorities to ensure default keyboard-mouse device is first. 2024-06-15 12:41:25 -05:00
Admiral H. Curtiss
a95c3dbc97
Merge pull request #12818 from iwubcode/json_file_operations
Common: add Json helper utilities for loading or saving to a file
2024-06-15 16:43:38 +02:00
iwubcode
50b95bbea9 InputCommon / VideoCommon: update to use new JsonFromFile function 2024-05-31 23:13:25 -05:00
Dentomologist
c3bdd05d2a TAS Input: Enable hotkeys and controller input when Input has focus
Enable emulator hotkeys and controller input (when that option is
enabled) when a TAS Input window has focus, as if it was the render
window instead.  This allows TASers to use frame advance and the like
without having to switch the focused window or disabling Hotkeys Require
Window Focus which also picks up keypresses while other apps are active.

Cursor updates are disabled when the TAS Input window has focus, as
otherwise the Wii IR widget (and anything else controlled by the mouse)
becomes unusable. The cursor continues to work normally when the render
window has focus.
2024-05-31 15:14:44 -07:00
Admiral H. Curtiss
321dc9b76d
Merge pull request #12711 from jordan-woyak/modifier-range-ini-default
InputCommon: Fix unnecessary "Modifier/Range" ini file entries.
2024-05-21 22:11:42 +02:00
Guilherme Janczak
50dc0ffbce
port to OpenBSD 2024-04-22 20:50:47 +00:00
Jordan Woyak
47b06d274e InputCommon: Fix unnecessary "Modifier/Range" ini file entries. 2024-04-15 18:32:31 -05:00
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