206 Commits

Author SHA1 Message Date
twinaphex
75188800b1 Use C comments 2017-02-19 04:37:40 +01:00
Diablodiab
2cbd1898e8 Android input driver mouse support fixes:
- Fix bug with cursor moving down to the right
- Remove handling of "copy" and "thread" input states simplifying the driver
2017-02-19 02:57:28 +01:00
Diablodiab
47d5242dd7 Add middle mouse button support to Android input driver
Add lightgun support to Android input driver
2017-02-16 21:52:52 +01:00
Diablodiab
4f039cac22 This adds external mouse support to the Android input driver. It also adds support for using the touch screen as mouse in cores with mouse support (eg. ScummVM).
It has been tested with the ScummVM core on:
- NVIDIA Shield TV running Android Nougat 7.0
- NVIDIA Shield Tablet running Android Nougat 7.0
- NVIDIA Shield Tablet running Android Lollipop 5.1
- Huawei Honor 7 running Android Marshmallow 6.0
- HTC Desire 500 running Android Jelly Bean 4.1

It's been tested using the touch screen, a USB mouse/keyboard combo, and a bluetooth mouse.

The Android version running on the device limits the functionality and user experience of the external mouse support.
Android Nougat and/or an NVIDIA SHIELD device with NVIDIA extensions provides the best user experience:

Android API < 14:
- Only left mouse button supported
- The Android mouse cursor will be visible along with the in game mouse cursor
- When the Android mouse cursor hits the edge of the screen it will not be possible to move the in-game mouse cursor further in that direction

Android API < 24 and no NVIDIA extensions available:
- Both left and right mouse buttons supported
- The Android mouse cursor will be visible along with the in game mouse cursor
- When the Android mouse cursor hits the edge of the screen it will not be possible to move the in-game mouse cursor further in that direction

Android API > 23 and/or NVIDIA extensions available (SHIELD devices):
- Both left and right mouse buttons supported
- The Android mouse cursor will be hidden
- The mouse is not limited by the (hidden) Android mouse cursor hitting the edge of the screen

Description of how the the touchscreen mouse support works:
- You can move the in-game mouse cursor using the touch screen. The in-game mouse cursor will move relative to your movements on the touch screen, it will not be centered on where you press the screen.
- One quick tap on the touch screen results in the left mouse button being clicked
- Two taps on the screen and keeping the second tap pressed down results in a left mouse being held down until you release
- Two fingers on the touch screen results in the right mouse button being clicked

The touch screen mouse functionality is active at the same time as overlay support. This might cause some confusion when using cores that are designed for mouse support but where you have also enabled overlay controls. At the top of android_input.c there's a define that can be used to turn off this functionality if it causes more problems than it solves.
2017-02-14 22:34:46 +01:00
twinaphex
96c8ca5a09 Header update #1 2017-01-22 13:40:32 +01:00
Aaron Kling
8a2585f8dc Handle motion events if source is touchscreen or mouse regardless
of other sources being set.

API level 9 doesn't support stylus, but still needs to be handled.
Current code throws out additional sources that it doesn't
recognize. This instead ignores whether other sources are set.
2017-01-13 18:37:50 -06:00
twinaphex
ea3dd6a95b Set device name when autoconfig connect task fails for all
other input drivers too
2017-01-13 05:00:13 +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
twinaphex
103042de96 Rewrite task_autodetect.c 2016-12-31 07:43:34 +01:00
twinaphex
aafae944cb Don't memset autoconfig_params_t 2016-12-17 14:26:13 +01:00
twinaphex
2153f3f011 Check if autodetect is enabled at beginning of connect task 2016-12-16 15:18:04 +01:00
twinaphex
209305f944 Connect task now sets PID/VID too 2016-12-16 14:02:11 +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
779b680264 (Android) Buildfix 2016-12-01 23:05:36 +01:00
twinaphex
d3c22cb0e4 Move input/input_autodetect.c to tasks/task_autodetect.c 2016-12-01 20:38:20 +01:00
twinaphex
76d0380e45 Rename input_autoconfigure_joypad to input_autoconfigure_connect 2016-12-01 18:57:44 +01:00
twinaphex
e689d55414 Rename autoconfig functions 2016-12-01 18:52:34 +01:00
twinaphex
31a95b8972 (android_input.c) Get rid of HAVE_MENU ifdefs 2016-12-01 17:31:26 +01:00
twinaphex
e9846aae68 (Android) Remove unused variables 2016-11-27 15:02:14 +01:00
twinaphex
95254aa79b Remove 'back as menu toggle' setting 2016-11-21 13:05:23 +01:00
twinaphex
763a925a17 Fix Android build 2016-10-29 04:59:56 +02:00
twinaphex
ce98a4dd19 Get rid of now unused input_driver_key_pressed 2016-10-29 04:57:28 +02:00
radius
6a950526d5 add group for other android atv devices 2016-10-28 20:49:44 -05: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
8ce882c829 Should hopefully fix most of the remaining issues 2016-10-26 10:29:26 +02:00
twinaphex
b0ed69f05c Optimize android_keyboard_port_input_pressed 2016-10-23 20:43:14 +02:00
twinaphex
647ffca76c Optimize input_joypad_pressed code 2016-10-23 20:37:12 +02:00
twinaphex
a4a1e96210 Prevent more implicit memsets 2016-10-16 01:40:29 +02:00
twinaphex
51b0e61712 Cleanups 2016-09-11 16:24:02 +02:00
twinaphex
012e069f86 Get rid of general.h includes 2016-09-11 13:21:56 +02:00
twinaphex
d4122806ab (Android) Buildfix 2016-09-05 18:34:21 +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
2f7684c743 (Android) Cleanups 2016-05-25 16:03:32 +02:00
radius
b6b2fdfaa6 comment out xbox 360 & dualshock hacks that are not needed anymore, friendly labels can be applied on the autoconf files instead 2016-05-25 00:47:01 -05:00
twinaphex
b79b2dca13 Create performance_counters 2016-05-10 08:53:14 +02:00
twinaphex
2691ab0c7d Rename command_event enums 2016-05-09 20:51:53 +02:00
twinaphex
a98ef36d36 Rename event_cmd_ctl to command_event 2016-05-09 20:20:50 +02:00
twinaphex
725c202498 Remove input_driver_ctl 2016-05-08 23:12:04 +02:00
Hans-Kristian Arntzen
8870e85395 More fixes for menu_display_ctl.
Grep shows nothing now.
2016-05-08 14:18:12 +02:00
Hans-Kristian Arntzen
66c4f608e6 Clear out rest of video_driver_ctl use. 2016-05-08 14:10:28 +02:00
Diablodiab
58c5cc6f46 Change ALooper_pollAll in android_input_poll from a non blocking call into a 1 ms
blocking call. For some reason this allows more input events to queue up in the
input queue for processing making it easier to press multiple gamepad buttons and
have it register within a single frame.
2016-04-29 00:42:09 +02:00
twinaphex
6f80e09ce1 Change MIN/MAX to upper-case 2016-03-02 00:07:31 +01:00
Diablodiab
84b6b505ad Fix crash when defining gamepad keys 2016-02-08 01:53:33 +01:00