Commit Graph

247 Commits

Author SHA1 Message Date
Koston-0xDEADBEEF
5201df3b44 input: Optimise autofire handling (#970)
Rearrange autofire logic to avoid unnecessary clock_gettime() syscalls.
2025-02-20 16:07:49 +08:00
terminator2k2
6bca8265c1 input: Add Sinden Light Gun (#968) 2025-02-18 16:25:23 +08:00
That One Seong
e484d703f7 input: Add support for OpenFIRE lightguns (#964)
* Add OpenFIRE lightguns to guns whitelist

* Add preliminary OpenFIRE support

Guns are detected as light guns based on static VID and OpenFIRE name prefix, as the PID can be any number of different values depending on the user.

Because OpenFIRE guns can be polled through serial devices, a basic (read: hacky) heuristic is used to poll for serial port paths and send a signal to compatible guns to enable their MiSTer compatible mode.

* Tabbbbbs

* Directly open and write to file rather than rely on system echo
2025-02-05 21:07:13 +08:00
Martin Donlon
5f9b703ae0 Adds support for Retroshooter lightguns operating in mouse mode. (#955)
Gun sends a mix of keyboard presses, mouse button presses and EV_ABS position data.
Added a QUIRK_LIGHTGUN_MOUSE quirk which passes the mouse button presses through the input system like other EV_KEY events instead of using them for mouse updates. This allows the mouse buttons to be mapped like regular joystick or keyboard buttons.
Added the left mouse button as a keycode that is accepted by the lightgun calibration menu.
Assign player if mouse button is pressed.
2025-01-19 15:48:41 +08:00
oddx2k
6b9b65bbdf Update input.cpp (#945)
Add support for Blamcon Lightguns
2024-12-30 20:18:02 +08:00
Matheus Fraguas
a5a50c528a Support for Thrustmaster T300RS (#931)
Support for Thrustmaster T300RS Racing Wheel. Must be in PC/PS3 mode.
2024-11-18 13:33:41 +08:00
Matheus Fraguas
81dae66a70 Support for Thrustmaster Wheels (#918)
Added support for 2 Thrustmaster Wheels:
FGT Rumble 3-in-1
F430 Cockpit Wireless
Wheel must be in PC MODE.
2024-09-16 23:11:05 +08:00
deepthaw
03f62ded4c Change in handling overlapping button presses (fixes issue #824) (#907)
* Modifications to input handling to prevent held inputs from being
overridden by an alternate input mapped to the same button.
i.e. R-Type holding fire to charge special shot will not be
disrupted if a secondary fire button is pressed, autofire
or not.

* Modifications to input handling to prevent held inputs from being overridden by an alternate input mapped to the same button.
i.e. R-Type holding fire to charge special shot will not be
disrupted if a secondary fire button is pressed, autofire
or not.

* Prevent held inputs from being disrupted by alternate inputs.

i.e. in R-Type, if holding the fire button to charge a special shot,
tapping an alternately assigned fire button will not cause the charge
to stop.
2024-06-30 15:02:49 +08:00
zakk4223
30e53d381b Set rumble direction to x-axis on wheel devices. (#906)
(Rumble has no direction, but many drivers convert this to a FF_SINE)
2024-06-26 13:55:10 +08:00
deepthaw
92441b319e adding approximate autofire rate in hz to OSD display (#905) 2024-06-24 12:56:51 +08:00
Sorgelig
1850ec3a5d Revert some changes. 2024-01-18 01:03:18 +08:00
Rikard Bengtsson
09e2f4fd03 Fix bug in dead zone code affecting DS3/DS4 (#866)
A small bug was introduced with the new dead zone code that made it ignore "quirks" regarding DS3/DS4. These devices should automatically be given a dead zone of 10, as it was before.
2024-01-15 13:00:13 +08:00
Matheus Fraguas
490c99dd6f Retrozord pid (#860)
* RetroZord VID:PID

Added the VID;PID to make_unique, and to the two special input modes.
Removed the Arduino Leonardo specific PID, leaving only he main arduino VID. So any DIY adapter using an arduino will work.

* Use UNIQ field on RetroZord Adapter
2023-12-09 22:12:53 +08:00
Rikard Bengtsson
542b6f4d73 Added dead zone configuration (#857)
User can define dead zone by device identifier and a radius.
2023-12-01 17:51:05 +08:00
trbocode
78edf5f58c Added controller handling for new N64 options (#838)
* Added controller handling for new N64 options

* Move to N64 folder and add per stick ranges

* Improve latency
2023-10-16 07:08:44 +08:00
Patrick Pollock
22834acc98 Scale N64 analog optimally for different gate shapes (#834)
* Scale N64 analog optimally wrt gate shapes

* Limit max_range to near diagonals

* Make magic numbers adjustable constants
2023-10-11 03:05:52 +08:00
Marcoen Hirschberg
d53a998eac N64 joystick emulation (#828)
* input.cpp: pass dev nr to joy_analog

This allows for per-controller behavior

* N64: add emulation for the analog joystick

This applies the reduced-range octagonal gate of the N64 analog stick to
regular analog sticks.

The code was mostly written by Patrick Pollock with small optimizations
by Martin Donlon and myself.
2023-09-24 17:22:02 +08:00
Sorgelig
a1c64c955c input: fix mapping. 2023-09-12 04:04:37 +08:00
Sorgelig
ce9daf6de9 input: make keyboard remap system-wide. 2023-09-12 02:55:36 +08:00
Sorgelig
f1cdcd5c46 input: improve keyboard remap dialog. 2023-09-10 14:41:00 +08:00
Sorgelig
1d36e3472f input: fix broken button skip in buttons definition. 2023-09-10 00:16:46 +08:00
Sorgelig
3bfadb39e8 input: make button/key remap permanent. 2023-09-07 22:09:54 +08:00
Javier Rodas
4236d70433 Add a second JAMMA quirk to support 4-player JAMMA-VERSUS with two JammaSD/J-PAC (or similar USB JAMMA) controller interfaces. (#811) 2023-09-05 05:44:00 +08:00
Martin Donlon
cdec51b121 Add two-player and per-controller type mapping support for the Reflex Adapt USB adaptor. Similar to other arduino leonardo based devices. (#803) 2023-08-17 02:07:36 +08:00
Dominic Evans
ab7fad101c input: support Thrustmaster Force Feedback Wheel (#801)
- add Thrustmaster Guillemot Force Feedback Racing Wheel (06f8:0004)
  case to setup_wheel for axis 8 (wheel), 9 (accel) and 10 (brake) with
  FF_AUTOCENTER support. This wheel uses the built-in `iforce` kernel
  module
- prevent input_cb from skipping axis 7 and 8 (previously assumed to be
  both paddle axis) if QUIRK_WHEEL is set on the device
- add wh_pedal_invert field to indicate that the pedal range needs to be
  inverted after normalization as the device input goes from minimum (0)
  offset to maximum (255) offset on pedal depression rather than maximum
  to minimum (like the existing supported wheels)
- comment the existing wh_ fields in setup_wheel to indicate their
  function

Fixes #799

Co-authored-by: Dominic Evans <oldmanuk@gmail.com>
2023-08-16 20:49:39 +08:00
Sorgelig
d5f41db979 input: support for multiple input devices mapping per player. 2023-05-28 21:41:58 +08:00
Sorgelig
872b433ed5 input: add selective unique mapping. 2023-05-22 20:18:24 +08:00
Sorgelig
a43d1a58c8 input: add vidpid as a clear text in unique mapping. 2023-05-21 16:05:39 +08:00
Sorgelig
51470c27cc input: remove sysfs from unique mapping. 2023-05-21 06:25:24 +08:00
Sorgelig
d6eefdcbdc input: make unique mapping per port. 2023-05-21 02:28:34 +08:00
Alexey Melnikov
0ebf137532 input: Controller unique mapping (preliminary)
Add ini option `unique_mapping` which makes controller mappings unique to the physical port the controller is connected to.
Calculates a uint32_t unique_hash for each device during enumeration.

Co-authored-by: Martin Donlon <github-martin@donlons.com>
2023-05-21 02:14:27 +08:00
Matheus Fraguas
0c03e569a8 Support to use mouse wheel as spinner. (#744) 2023-02-22 04:13:20 +08:00
Sorgelig
2d40444af0 ini option to disable autofire. 2022-11-28 20:46:42 +08:00
Sorgelig
7913771888 input: add pageup/pagedown buttons to controller in linux console. 2022-11-11 19:37:42 +08:00
Sorgelig
19594babaf input: permanent controller assignment now searches in Sysfs as well. 2022-11-01 02:05:27 +08:00
Sorgelig
631276d59d Add MiSTer_cmd command: volume mute/unmute/0-7. 2022-10-31 23:05:20 +08:00
Sorgelig
6bda023db8 Add INI option for permanent controller assignment to specific player. 2022-10-31 19:53:50 +08:00
zakk4223
b1d6ee2f52 Support "guide2" in gamecontrollerdb for OSD button chords. Support the +/- analog axis notation for mapping analog to digital buttons (#692)
Co-authored-by: Zakk <zakk@rsdio.com>
2022-09-09 18:39:24 +08:00
zakk4223
e28c6616b6 input: Use sub_dev to find controller db entries: fixes some multifunctional devices (#689)
Co-authored-by: Zakk <zakk@rsdio.com>
2022-08-30 14:07:23 +08:00
zakk4223
5b4acd3c7b input: add support for sdl gamecontrollerdb to setup default mappings for controllers
* Add support for sdl style gamecontrollerdb to setup default mappings for controllers

* Do not cache game controller entries, find them dynamically in the file when needed

Co-authored-by: Zakk <zakk@rsdio.com>
2022-08-22 21:46:16 +08:00
makigumo
051ffd3a4d input: add key values for japanese keyboards (#674) 2022-08-03 23:12:35 +08:00
Martin Donlon
cebd306abd Spike profiler 2022-07-17 11:58:16 -07:00
Sorgelig
ba837a789e input: fix: vibration test could stick. 2022-06-06 19:54:10 +08:00
Sorgelig
a20b86d3cd input: enable vibration test by holding L button. 2022-06-06 19:43:10 +08:00
JB
1845079eb6 input: Added Gun4IR lightgun support to input.cpp (#633)
Added support for the Gun4IR lightgun to the lightgun input list, for native support.
2022-06-06 00:01:02 +08:00
jaysonlarose
ac86f967a4 input: Changed wh_break to wh_brake. (#621) 2022-05-25 18:22:45 +08:00
Matheus Fraguas
0f0affb238 NeGcon as wheel via RetroZord adapter (arduino based) (#607) 2022-05-20 07:43:53 +08:00
Nolan Nicholson
8f80dbab77 CRT lightguns: 50 ms offscreen grace period (#599)
When a CRT lightgun starts reporting out-of-screen coordinates,
the last good on-screen coordinates are retained and passed through
for 50 ms. This improves GunCon 2 performance on NES, and generally
makes CRT-based guns a bit more reliable in games with a lot of dark
areas.
2022-05-09 15:00:28 +08:00
Sorgelig
28a751cc89 input: refactored wheel setup code. 2022-04-22 05:21:54 +08:00
Michael Huang
ef50535f74 Add Fanatec wheels (#583) 2022-04-21 22:45:17 +08:00