Commit Graph

248 Commits

Author SHA1 Message Date
twinaphex ee3208ac39 Integrate video_driver.c into retroarch.c 2019-06-17 15:10:22 +02:00
Zoran Vuckovic 2b2903cfff Fix issue #8326 2019-02-28 21:56:38 +01:00
orbea 28ff4b391a Clean up white space. 2019-02-03 16:00:50 -08:00
orbea 5d56080312 Use the posix poll.h instead of sys/poll.h. 2019-02-01 09:58:04 -08:00
orbea bfc366decc Squeeze extra blank lines with cat(1).
Example:

find . -type f -iname '*.c' | while read -r i; do
  cat -s "$i" > "$i.new"
  mv "$i.new" "$i"
done
2019-01-08 11:04:58 -08:00
orbea 2b0838ac02 udev: Disable the mouse when the window has lost focus. (#7851)
Fixes https://github.com/libretro/RetroArch/issues/5520

v2: Move check to udev_handle_mouse().
v3: Change check to udev_get_mouse to fix issue reported by RobLoach.
2019-01-05 19:56:41 -05:00
Greg V a838582b11 udev: support on FreeBSD via libepoll-shim/libudev-devd 2019-01-01 03:16:33 +03:00
grant2258 3a0c27e753 use none zero as requested 2018-12-17 00:07:00 +00:00
grant2258 74de0ade03 resolve changes 2018-12-16 20:52:15 +00:00
grant2258 fd6856ce20 fix tpouchpad as well 2018-12-12 18:27:29 +00:00
grant2258 1d8dd133b7 tidy code up 2018-12-12 17:29:31 +00:00
grant2258 07b17059f1 fix udev mouse 2018-12-11 23:24:21 +00:00
twinaphex 13431c7cbf (udev) Fix game focus toggle for udev input driver 2018-07-15 14:20:26 +02:00
Brad Parker 039da3bb83 C89 buildfix 2018-02-06 22:17:32 -05:00
twinaphex 61ff51be2f Start using string_is_equal predominantly 2018-01-16 22:53:38 +01:00
David Walters c76545bf6c Compile fix. 2018-01-11 17:03:18 +00:00
David Walters 3dc3534498 Merge branch 'master' of https://github.com/libretro/RetroArch into udev_lightgun_api 2018-01-08 14:37:05 +00:00
twinaphex 69f85556a3 Get rid of meta_key_pressed 2017-12-18 05:59:57 +01:00
twinaphex 7b210ccf37 Don't call meta key pressed if not bound 2017-12-18 05:49:17 +01:00
David Walters cbfdd7bbd9 udev lightgun fixes 2017-12-03 09:40:36 +00:00
David Walters c453675d38 lightgun support in udev 2017-12-02 13:24:17 +00:00
twinaphex 6c69002ab4 Start adding not-complete kqueue codepaths - bparker - see if you can
finish this up
2017-11-30 07:28:59 +01:00
twinaphex 62280439b7 Rename epfd to fd 2017-11-30 07:00:25 +01:00
Zoran Vuckovic 5c46e176d5 Add keyboard/mouse device index logging 2017-10-07 06:59:45 +02:00
Zoran Vuckovic 12d0f4107a Use int32_t instead of __s32 2017-10-05 10:00:20 +02:00
Zoran Vuckovic 135b636bd4 Add "absolute" mouse support 2017-10-05 05:18:53 +02:00
Zoran Vuckovic 84d33fb847 Disable keyboard input if window is not active 2017-09-10 05:50:10 +02:00
twinaphex e16371b8a5 Merge input_config.c and input_driver.c 2017-08-31 02:25:04 +02:00
Brad Parker b9036e26a7 fix buffer overflow 2017-07-22 16:08:05 -04:00
Zoran Vuckovic aa99f4f5ba Disable keyboard input and restrict mouse input in some cases 2017-07-18 01:16:48 +02:00
Paolo Bonzini d1dc2e9670 add support for remote control devices and other ID_INPUT_KEY devices
* the remote control presents itself as ID_INPUT_KEY, not
ID_INPUT_KEYBOARD.  However, ID_INPUT_KEYBOARD is a subset of
ID_INPUT_KEY.

* the remote control lacks the backspace and enter keys, which are hard
coded in RetroArch. It has "back" and "ok" instead, so map those to
RETROK_BACKSPACE and RETROK_ENTER as well.

Remote controls also have no ESC key, but that one is customizable
and I used the Power key of the remote (which already has a mapping
to RETROK_POWER).

The functionality provided is really the bare minimum, but it is enough
to teach a kid "press the power button here to watch TV"; compared to
pressing L1+R1+START+SELECT and navigating to the RetroArch's "quit"
menu item, that hopefully has more chances of success.
2017-07-02 10:50:00 +02:00
twinaphex fe829e5eb0 Fix C89_BUILD 2017-06-28 18:01:04 +02:00
Twinaphex 5c5c5ecbdf Revert "udev input: support controlling the menu with a TV remote control" 2017-06-22 20:53:07 +02:00
Paolo Bonzini d5cdbca322 add support for remote control devices and other ID_INPUT_KEY devices
* the remote control presents itself as ID_INPUT_KEY, not
ID_INPUT_KEYBOARD.  However, ID_INPUT_KEYBOARD is a subset of
ID_INPUT_KEY.

* the remote control lacks the backspace and enter keys, which are hard
coded in RetroArch. It has "back" and "ok" instead, so map those to
RETROK_BACKSPACE and RETROK_ENTER as well.

Remote controls also have no ESC key, but that one is customizable
and I used the Power key of the remote (which already has a mapping
to RETROK_POWER).

The functionality provided is really the bare minimum, but it is enough
to teach a kid "press the power button here to watch TV"; compared to
pressing L1+R1+START+SELECT and navigating to the RetroArch's "quit"
menu item, that hopefully has more chances of success.
2017-06-19 15:09:13 +02:00
twinaphex 1598042e8e (udev) Keyboard should work again in DRM/KMS 2017-06-12 12:09:19 +02:00
twinaphex e92feb85af Use epoll functions directly 2017-06-11 20:44:02 +02:00
twinaphex 060753258a Combine input_driver.c and input_keyboard.c 2017-06-11 17:51:12 +02:00
twinaphex 95e588ce0f Fix C89_BUILD 2017-06-10 12:52:45 +02:00
twinaphex 34be5566dd (udev fix) This fixes touchpad movement inside the menu 2017-06-10 12:27:22 +02:00
twinaphex 84f5fa1f26 (epoll_common.c) Cleanups; don't use verbosity logging inside 2017-06-10 12:07:01 +02:00
twinaphex c70526b7af Fix hotplug regressions with udev 2017-06-10 11:58:22 +02:00
twinaphex e8c73c6683 Rewrite other input drivers too 2017-06-10 11:22:24 +02:00
twinaphex 37656eed84 (udev_input.c) Rework input_state 2017-06-10 10:58:56 +02:00
Twinaphex 6d85e1f0a6 Merge pull request #5045 from casdevel/mice
Add player mouse device selection
2017-06-10 04:13:16 +02:00
Zoran Vuckovic e698e75a51 Adapt touchpad code for multiple mice support 2017-06-09 21:17:11 +02:00
twinaphex 8980f8c1ea Get rid of useless wrapper function epoll_waiting 2017-06-08 21:52:50 +02:00
twinaphex eb08a86647 Get rid of udev_common.c 2017-06-08 21:46:26 +02:00
Zoran Vuckovic 44930716ba Add player mouse index handling to udev input driver 2017-06-08 18:49:08 +02:00
Zoran Vuckovic ceca89e104 Fix DRM/KMS keyboard handling 2017-06-07 12:25:10 +02:00
twinaphex 603d4d0464 (udev/x11) Simplifications 2017-06-07 01:17:55 +02:00
twinaphex 604a558382 Get rid of input_wl_is_pressed 2017-06-07 00:09:31 +02:00
twinaphex 6b3dbff75f Merge input_driver.c and input_joypad_driver.c 2017-06-06 05:56:02 +02:00
twinaphex 9ebfb36b4e Use rarch_keysym_lut directly 2017-06-06 05:17:25 +02:00
twinaphex e276142be3 (udev_input.c) Cleanup 2017-06-06 04:18:35 +02:00
twinaphex 15c4f82dec (udev_input.c) Cleanups 2017-06-06 03:59:52 +02:00
twinaphex c3c772a79a (udev) Avoid warning with helgrind - input descriptor -1 is invalid 2017-06-05 05:18:38 +02:00
twinaphex 8b945a103f (udev_input.c) Set st_dev manually 2017-06-04 21:16:35 +02:00
Zoran Vuckovic ab793b92a3 Remove XKBCOMMON code 2017-06-04 07:23:32 +02:00
Zoran Vuckovic 1911aadc19 Remove duplicate keyboard handling 2017-06-04 07:16:57 +02:00
twinaphex 85058fbe5c (udev_input.c) Some cleanups and a runtime check for X11 2017-06-03 18:54:04 +02:00
Zoran Vuckovic 210da4d204 Add ifdef checks for X11-specific code 2017-06-03 18:01:27 +02:00
Zoran Vuckovic 05a90f7f70 Add mouse grab/ungrab feature 2017-06-03 16:26:08 +02:00
Zoran Vuckovic 39a9ac8444 Add pointer handling to fullscreen mode 2017-06-03 12:46:53 +02:00
Zoran Vuckovic 11559f294a Add multiple mice support to udev driver 2017-06-02 07:57:07 +02:00
twinaphex f83a26c8b0 (udev_input.c) Simplifications 2017-05-20 20:50:23 +02:00
twinaphex 9f6dc975da Simplify udev_input.c 2017-05-20 20:35:42 +02:00
twinaphex 5a9dbf7e4f Merge keyboard files for udev/x11 2017-05-20 19:44:04 +02:00
twinaphex 126a5bf121 Use string_is_equal_fast/string_is_not_equal_fast 2017-05-16 04:00:37 +02:00
twinaphex f9bc2d3783 Use memcmp instead of string_is_equal where possible for
better performance
2017-04-21 22:47:15 +02:00
twinaphex 7f4b490fdb Prevent implicit memsets with struct video_viewport 2017-04-15 19:43:52 +02:00
twinaphex 96c8ca5a09 Header update #1 2017-01-22 13:40:32 +01:00
twinaphex 8bd12368ef Pass joypad_driver name to input_driver_init function and make
sure we don't need to access the settings struct from the
input driver
2017-01-10 17:59:48 +01:00
twinaphex d48141041d Pass joypad_info to input_state function callback - less
settings pointer grabbing
2017-01-10 17:40:21 +01:00
twinaphex da4d2a9f42 Remove conditionals for device JOYPAD from input_state callback functions 2017-01-10 17:05:04 +01:00
twinaphex b9945f05f1 Pass joypad_info to input_joypad_analog 2017-01-10 03:53:57 +01:00
twinaphex 6376f2af68 Add rarch_joypad_info_t 2017-01-10 03:44:53 +01:00
Hans-Kristian Arntzen b2059dcb79 Implement basic Wayland keyboard and mouse. 2016-12-17 20:28:08 +01:00
twinaphex dc7549434f Add headers 2016-12-07 08:10:02 +01:00
twinaphex a12d0d082d Move input_translate_coord_viewport to video_driver.c 2016-12-07 08:07:11 +01:00
twinaphex 2ba311274e Simplify input_translate_coord_viewport 2016-12-05 05:18:36 +01:00
twinaphex 021559a877 Get rid of runloop.h dependencies inside input/ dir 2016-12-02 06:07:45 +01:00
Brad Parker ba54f20626 initial libcaca video driver 2016-12-01 12:13:45 -05:00
twinaphex a9e627ca57 (udev_input.c) Rename static function 2016-12-01 17:33:41 +01:00
twinaphex 200be98052 (udev_input.c) use udev_common.c 2016-12-01 16:51:43 +01:00
twinaphex 9afa24ea70 Reuse udev_common.c function 2016-12-01 15:05:17 +01:00
twinaphex ce98a4dd19 Get rid of now unused input_driver_key_pressed 2016-10-29 04:57:28 +02:00
twinaphex d246d320c7 Get rid of messy 'all_users_control_menu' hack - will be dealt
with better once menu_input branch has been merged
2016-10-27 07:00:13 +02:00
twinaphex d6901685f7 Prevent crash with udev driver 2016-10-26 10:21:56 +02:00
twinaphex 294f54ebf0 Cleanup udev_pointer_state 2016-10-24 02:47:29 +02:00
twinaphex 647ffca76c Optimize input_joypad_pressed code 2016-10-23 20:37:12 +02:00
twinaphex 6a02cf174e udev_input_poll - add early return in case udev is NULL 2016-09-18 20:32:16 +02:00
twinaphex 075aea2289 Header include cleanups 2016-09-06 00:56:00 +02:00
twinaphex acd4dd527b Header include cleanups 2016-09-05 18:31:32 +02:00
Brad Parker a17679a0c5 add input option to allow any user to control the menu 2016-09-03 19:01:29 -04:00
twinaphex 20f7d82f95 More header include cleanups 2016-09-01 18:07:44 +02:00
twinaphex ba7d638b99 Use string_is_equal 2016-08-29 18:46:41 +02:00
twinaphex d5d2f7f8ee Fix resource leaks 2016-05-23 22:17:28 +02:00
twinaphex 6db13ab51d (udev) cleanup 2016-04-28 22:50:02 +02:00
twinaphex fbd2e9aa84 Use string_is_equal more 2016-01-21 02:48:00 +01:00
twinaphex ef7a786527 Attempt to prevent segfault when pressing Enter in DRM/KMS mode 2016-01-02 22:28:21 +01:00
twinaphex b8bbdc6f4c Revert udev drivers 2015-12-17 03:02:48 +01:00
twinaphex 7cb78cca58 Make g_epoll static 2015-11-30 18:14:07 +01:00
twinaphex 54655c37cd Create epoll_waiting 2015-11-30 18:08:00 +01:00
twinaphex ecbfc72e9b Create epoll_common 2015-11-30 18:05:10 +01:00
twinaphex 6d90c42bb5 We need to check for the instance where udev is only initialized
for the joypad part and not the general input driver
2015-11-30 16:56:32 +01:00
twinaphex 62260cf892 Turn g_udev static 2015-11-30 16:52:29 +01:00
twinaphex 28602d84af Make g_udev_mon static 2015-11-30 16:47:43 +01:00
twinaphex b76481b21e Create udev_mon_hotplug_available 2015-11-30 16:42:52 +01:00
twinaphex 2db1197942 Expand udev_common.c 2015-11-30 16:39:22 +01:00
twinaphex dff44d8d49 (udev) split up keyboard code to separate files 2015-11-29 15:35:34 +01:00
twinaphex 6c7da0e503 (udev) Change function signature of callback 2015-11-29 06:34:35 +01:00
twinaphex c23846c5dc Merged input_joypad.c and input_joypad_driver.c 2015-11-28 16:22:49 +01:00
twinaphex a6ccc188a8 Rename input_common.c to input_config.c 2015-11-28 02:22:58 +01:00
twinaphex 074f14b132 Add verbosity.c/verbosity.h 2015-11-23 12:03:38 +01:00
twinaphex 3bc125b6da move most xkbcommon code to keyboard_event_xkb.c 2015-11-17 07:28:45 +01:00
twinaphex 03b1f36af1 Move linux_common to input/common/ 2015-11-17 06:46:32 +01:00
twinaphex 1360942283 Buildfixes 2015-11-16 02:42:10 +01:00
twinaphex bfec58154e Move code to linux_common.c 2015-11-14 22:03:37 +01:00
twinaphex 465a608a56 More cleanups 2015-11-14 09:04:01 +01:00
twinaphex 49dad39bf4 (udev) Reuse linux_common code 2015-11-14 09:01:41 +01:00
twinaphex 22f85b11df Don't need this anymore 2015-11-07 20:59:12 +01:00
twinaphex 90cb9c5157 (udev_input.c) Cleanup 2015-10-23 08:22:59 +02:00
twinaphex 1a20e19c51 We will now be able to know from which input device type the input
event comes from - i.e. keyboard or gamepad
2015-10-22 19:17:47 +02:00
twinaphex 8fc33b386b (udev) Start adding RETRO_DEVICE_POINTER / RETRO_DEVICE_POINTER_SCREEN -
untested
2015-10-10 10:35:45 +02:00
twinaphex 87d44af218 Static code analysis cleanups 2015-09-29 18:08:33 +02:00
twinaphex 0cc56e2a1a More static code analysis nits 2015-09-28 18:44:28 +02:00
twinaphex 450c665619 Create meta_key_pressed 2015-07-17 03:31:51 +02:00
twinaphex 2a881d64be Name some functions the same across drivers 2015-07-12 08:51:13 +02:00
twinaphex 9e61a5ebf4 (udev_input.c) Cleanup add_device 2015-07-12 02:44:53 +02:00
Alcaro 1bbd54f597 Some C89 strict fixes 2015-06-26 17:03:12 +02:00
twinaphex 0e046c2fbb Create input_driver_keyboard_mapping_is_blocked/input_driver_keyboard_mapping_set_block 2015-06-19 03:45:23 +02:00
twinaphex ca4b8385fe (udev_input.c) Include <unistd.h> 2015-06-13 19:16:42 +02:00
twinaphex 77ba9c650f (udev) Use {{0}} for initialization 2015-06-03 21:29:08 +02:00
twinaphex 660641f328 Pass handle to input driver to joypad driver's init function 2015-06-03 18:22:54 +02:00
twinaphex bafda714a1 (Input drivers) Cleanups 2015-06-03 18:12:06 +02:00
twinaphex 17ca5a074c (udev_input.c) Cleanups 2015-06-03 17:11:32 +02:00
twinaphex 1532f35376 (udev_input.c) Cleanups 2015-06-03 17:06:22 +02:00
twinaphex 3a7263020a Add grab_stdin function pointer to input driver - avoids threading
segfault at exit with linuxraw input driver to do with driver->stdin_claimed
2015-05-19 19:33:58 +02:00
twinaphex 8c6cce3945 Rename rarch_joypad_driver_t to input_device_driver_t 2015-04-14 16:37:59 +02:00
twinaphex 5ad9f131ce Updates pt. 5 2015-03-20 22:32:09 +01:00
twinaphex e366a6eaa2 (Mouse) Start adding preliminary horizontal mouse wheel up/down 2015-03-12 05:38:37 +01:00
twinaphex 894076f52d (xdk_xinput_input) Cleanup 2015-03-09 19:00:01 +01:00
twinaphex 0ab0fdf709 (Menu) Implement wheel up/down - will need kivutar to implement this
better
2015-03-09 16:36:49 +01:00
twinaphex b93b9d8b58 (udev) Implement wheel up/wheel down 2015-03-09 16:23:22 +01:00
Higor Eurípedes f8e4fa25bb (griffin) Fix udev drivers build 2015-02-20 23:35:39 -03:00
twinaphex 31a54223e5 Get rid of useless wrapper function around button presses 2015-02-15 00:42:40 +01:00
twinaphex 46402deb04 Use PATH_MAX_LENGTH instead of PATH_MAX.
Refactor OSX settings menu code somewhat
2015-01-17 05:47:52 +01:00
twinaphex 76ad6cc344 Move input drivers to input/drivers 2015-01-12 06:16:52 +01:00