summaryrefslogtreecommitdiffstats
path: root/wscript_build.py
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2019-10-22 16:41:19 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2019-10-23 09:40:30 +0200
commit899e0bd16bcf80b0a1badbafeb83d3f474f24261 (patch)
treea9adca33672534629d9af5bfcc01834fd5c382dc /wscript_build.py
parent79b15f50e31d62b50d1c20160fa7ec489d3b05e5 (diff)
downloadmpv-899e0bd16bcf80b0a1badbafeb83d3f474f24261.tar.bz2
mpv-899e0bd16bcf80b0a1badbafeb83d3f474f24261.tar.xz
input: add gamepad support through SDL2
The code is very basic: - only handles gamepads, could be extended for generic joysticks in the future. - only has button mappings for controllers natively supported by SDL2. I heard more can be added through env vars, there's also ways to load mappings from text files, but I'd rather not go there yet. Common ones like Dualshock are supported natively. - analog buttons (TRIGGER and AXIS) are mapped to discrete buttons using an activation threshold. - only supports one gamepad at a time. the feature is intented to use gamepads as evolved remote controls, not play multiplayer games in mpv :)
Diffstat (limited to 'wscript_build.py')
-rw-r--r--wscript_build.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/wscript_build.py b/wscript_build.py
index 9f47153413..951584ec9d 100644
--- a/wscript_build.py
+++ b/wscript_build.py
@@ -257,7 +257,7 @@ def build(ctx):
( "audio/out/ao_pcm.c" ),
( "audio/out/ao_pulse.c", "pulse" ),
( "audio/out/ao_rsound.c", "rsound" ),
- ( "audio/out/ao_sdl.c", "sdl2" ),
+ ( "audio/out/ao_sdl.c", "sdl2-audio" ),
( "audio/out/ao_sndio.c", "sndio" ),
( "audio/out/ao_wasapi.c", "wasapi" ),
( "audio/out/ao_wasapi_changenotify.c", "wasapi" ),
@@ -320,6 +320,7 @@ def build(ctx):
( ipc_c ),
( "input/keycodes.c" ),
( "input/pipe-win32.c", "win32-pipes" ),
+ ( "input/sdl_gamepad.c", "sdl2-gamepad" ),
## Misc
( "misc/bstr.c" ),
@@ -490,7 +491,7 @@ def build(ctx):
( "video/out/vo_mediacodec_embed.c", "android" ),
( "video/out/vo_null.c" ),
( "video/out/vo_rpi.c", "rpi-mmal" ),
- ( "video/out/vo_sdl.c", "sdl2" ),
+ ( "video/out/vo_sdl.c", "sdl2-video" ),
( "video/out/vo_tct.c" ),
( "video/out/vo_vaapi.c", "vaapi-x11 && gpl" ),
( "video/out/vo_vdpau.c", "vdpau" ),