239 Commits

Author SHA1 Message Date
Nicolas Adenis-Lamarre
7e2e87ad4a
fix udev guns input when id_mouse is not id_joystick (#15026)
the commit cfe9d60f5100d3d0a1d6119d156b91dd66ae8195
introduces an issues on guns inputs for drivers udev, dinput, winraw and x11.
A local variable called "port" is redefining the function argument variable and
is causing bad calls in subsequent function calls.

In short, functionnally, if you have only 1 gun and 1 pad on your system, all works.
As soon as you use several pads or several guns, you may have issues,
because subsequent calls use the joystick port instead of the device port as argument.

IMPORTANT NOTE : this fix was done originally for the batocera project which uses only the udev driver,
this is why it is focused on udev only.
The same thing must be done and tested for dinput, winraw and x11.
I've not the ability to test them.

Signed-off-by: Nicolas Adenis-Lamarre <nicolas.adenis.lamarre@gmail.com>
2023-02-26 15:52:20 +01:00
libretroadmin
7ebab640d7 Cleanups/style nits 2023-02-23 13:15:14 +01:00
libretroadmin
963bb92f95 (Input) Style nits/code simplifications 2023-02-19 06:30:14 +01:00
neil4
b98c53ddb7
Improve haptic feedback for input overlays (#14517)
Repurpose vibrate_on_keypress to enable device's standard keypress feedback on overlay key/button state changes

- Add keypress_vibrate function ptr to input_driver_t (only implemented on Android for now)
- (Android) Remove APP_CMD_VIBRATE_KEYPRESS
- (Android) Add doHapticFeedback, called directly to avoid latency
2022-10-16 09:58:09 +02:00
LibretroAdmin
d0c6dfee0b Cleanup bitmask setting 2022-10-05 18:43:58 +02:00
StormedBubbles
53d0e161e1
Fix lightgun scaling on Y axis 2022-06-16 22:16:32 -04:00
Dystopian
0afdb2a0cf
Improve udev logging (#13549) 2022-01-29 10:57:38 +01:00
arpruss
e5e6f343ac
convert abs mouse from screen to viewport coordinates; fix relative m… (#13258)
* convert abs mouse from screen to viewport coordinates; fix relative mouse code to work in screen mode

* C89 compatibility

* revert accidental include
2021-12-18 17:52:27 +01:00
Jean-André Santoni
6a99832a4d
Lakka: Patch to fix keyboard typing
Upstream of patch used by Lakka at build time
1943ad296e/packages/libretro/retroarch/patches/retroarch-01-xkb-fix.patch
2021-11-18 00:36:11 +01:00
twinaphex
619398bbe4 Backport parts of 73c0760236 2021-11-09 23:12:57 +01:00
grant2258
1ae36ee9a7
udev fix dolphinbar and safeguard against not adding devices with no mouse or touch buttons detected (#13143)
* udev fixes

* updates

* small updates

* fix condition

Co-authored-by: grant2258 <you@example.com>
2021-11-05 23:59:17 +01:00
Jamiras
088aa7dcb9
add github action for c89 build (#13186)
* add retroarch.yml

* fix c89 errors

* attempt to add dependencies

* update comments
2021-11-05 00:05:13 +01:00
gblues
1ef78d3e3d
Any pad can control the menu (#13173)
* Any pad can control the menu

== DETAILS
I am not sure I've quite got it so that any pad can *open* the
menu, but I do have it so any pad can control it.

- split out the input processing into a separate method
- track down and squish some hairy bugs that boiled down to
  bad pointer math
- it looks like `menu_driver.c` has a mix of line endings, so I
  ran it through `dos2unix` so it has consistent line endings
  again.
- verified that this change did not impact actual cores

* optimize out cumulative_bits

* Incorporate PR feedback

Many thanks to @jdgleaver for providing these optimizations.

* apply one more optimization
2021-11-03 16:32:15 +01:00
grant2258
6e8a3945d5 add extra abs check for dolphinbar 2021-10-18 03:43:49 +01:00
grant2258
1fca7507dc cleanup 2021-10-16 19:36:35 +01:00
grant2258
a68e5205bd add relative left mouse button when pointer device is not abs 2021-10-16 19:26:40 +01:00
grant2258
a327fdb6fe
add mouse relative check and set appropiatley to fix issue (#12994)
* re add this after failed rebase

* update

* temp fix for device friendly naming as it is for testing

* add device friendly names in the appropiate place

* add/remove hotplug dev to ra input mouse port list

Co-authored-by: grant2258 <you@example.com>
2021-09-24 18:31:20 +02:00
jdgleaver
12f787547c
Add workaround to fix keyboard input when using x11+udev (#12981) 2021-09-13 18:02:40 +02:00
grant2258
88b15c1b1d this function is called more than once dont use static 2021-09-12 20:58:49 +01:00
Ryan C. Gordon
9a6faa3ddd
udev_input.c: Look for "ID_INPUT_KEY", not "ID_INPUT_KEYBOARD"
This fixes programs using /dev/uinput to create a virtual keyboard failing
to be detected on startup. Usual symptom is some sort of GPIO-based
controller that looks like a keyboard to the OS and can control
EmulationStation, but fails to work in-game unless you restart the program
while the game is running (in which case udev_input.c's hotplug code, which
was using the correct key, would pick it up).
2021-08-19 16:00:57 -04:00
sonninnos
bd3533f05d Friendly names for mice where available 2021-08-06 00:21:17 +03:00
amtz
d0612f906d Limit udev device scan to subsystem 'input'
This change makes the call to 'udev_enumerate_scan_devices' much faster.
In particular, for some bluetooth devices, this function may implicitly
read its battery's virtual file 'uevent', e.g.

/sys/devices/*/usb1/1-1/*/bluetooth/hci0/*/power_supply/hid-*-battery/uevent

Reading this file may (for unknown reasons) block up to 10 seconds.
Since udev_enumerate_scan_devices is called 4 times (for keyboard,
mouse, touchpad, and joypad) during startup this may cause a
considerable delay.

Limiting the scan to subsystem 'input' yields the same devices but makes
the scan faster and does not read 'uevent' of the input controller's
power_supply.
2021-08-02 13:17:00 +02:00
Grant
d6a1c21fe1 udev fixes] 2021-06-26 23:09:47 +01:00
Grant
c73592d379 skip mouse with no button errors and keep the rest 2021-06-22 23:00:50 +01:00
Grant
4ba0ba4c70 fix up logging that can confuse users 2021-06-22 22:06:19 +01:00
Autechre
bd937eb49f
Merge pull request #12536 from grant2258/udev
only add mouse if it has buttons and add vebose device friendly names
2021-06-22 17:23:19 +02:00
Autechre
6986caed5b
Merge pull request #11388 from pjft/dual-lightgun
Change udev driver for dual lightgun support in X11
2021-06-21 18:06:35 +02:00
Grant
6e2709d62a cleanup 2021-06-19 08:47:35 +01:00
Grant
eef86d5f72 fix game focus mode 2021-06-19 07:59:06 +01:00
Grant
863aaa5b9d Revert "fix game focus mode on udev as well"
This reverts commit 54eed6341862be97e1a40ba19984bc666f368592.
2021-06-19 07:44:02 +01:00
Grant
54eed63418 fix game focus mode on udev as well 2021-06-19 07:00:09 +01:00
Grant
7915b040a9 only add mouse if it ha buttons and add vebose device friendly names 2021-06-18 03:55:25 +01:00
David Carlier
3b7e0a8db1 FreeBSD build fix proposal 2021-05-01 15:37:14 +01:00
twinaphex
cfe9d60f51 Get rid of button_is_pressed 2021-04-15 06:55:35 +02:00
twinaphex
f1cf5ceb82 (input drivers) Cut down on code duplication 2021-04-11 16:31:46 +02:00
twinaphex
05a2623875 (udev input) Cut down on code duplication 2021-04-11 06:37:49 +02:00
twinaphex
ca5ce839ce Small cleanups to button input handling code - several parameters
were no longer used
2021-04-10 19:06:56 +02:00
pjft
0a83817f25
Merge branch 'master' into dual-lightgun 2021-01-18 11:23:44 +00:00
twinaphex
22e966be5b Cleanups 2020-12-09 22:25:05 +01:00
jdgleaver
3fa1166ec4 (udev/linuxraw/wayland) Fix return key keyboard input 2020-09-29 11:23:35 +01:00
pjft
f8b4289811 Change udev driver for dual lightgun support in X11 2020-09-28 21:25:51 +01:00
twinaphex
1c5f4e1dee Start cutting down on input_state - move all joypad driver code up to
higher-level retroarch.c
2020-09-02 15:26:03 +02:00
twinaphex
2fde8c21a9 Remove set_rumble function from input driver 2020-09-02 00:38:11 +02:00
twinaphex
acc0f2143f Change input_key_pressed so we no longer need to pass joypad
to the poll function callback
2020-09-01 21:43:39 +02:00
twinaphex
1d67ae3c63 Fix Android error 2020-09-01 17:41:05 +02:00
Autechre
87e35d56ae
Merge pull request #11264 from libretro/refact-joypad
Refactor joypad/input drivers
2020-08-31 20:04:18 +02:00
twinaphex
6b756986d5 (UDev) Buildfix for platforms that don't define UDEV_XKB_HANDLING 2020-08-31 14:04:36 +02:00
twinaphex
fe6d047bfe (Udev) Cleanups 2020-08-31 03:38:51 +02:00
twinaphex
6f92c56ca3 Simplify input drivers 2020-08-31 02:07:43 +02:00
twinaphex
d4d8b6934a Put keyboard_mapping_blocked into p_rarch / rarch struct
instead
2020-08-30 18:47:29 +02:00