From 899e0bd16bcf80b0a1badbafeb83d3f474f24261 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 22 Oct 2019 16:41:19 +0200 Subject: 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 :) --- wscript | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index b1fc93a8e0..c2b84411a5 100644 --- a/wscript +++ b/wscript @@ -420,6 +420,16 @@ iconv support use --disable-iconv.", 'deps': 'gpl', 'func': check_true, 'default': 'disable', + }, { + 'name': '--sdl2', + 'desc': 'SDL2', + 'func': check_pkg_config('sdl2'), + 'default': 'disable', + }, { + 'name': '--sdl2-gamepad', + 'desc': 'SDL2 gamepad input', + 'deps': 'sdl2', + 'func': check_true, } ] @@ -499,10 +509,10 @@ FFmpeg/Libav libraries. Git master is recommended." audio_output_features = [ { - 'name': '--sdl2', - 'desc': 'SDL2', - 'func': check_pkg_config('sdl2'), - 'default': 'disable' + 'name': '--sdl2-audio', + 'desc': 'SDL2 audio output', + 'deps': 'sdl2', + 'func': check_true, }, { 'name': '--oss-audio', 'desc': 'OSS', @@ -563,6 +573,11 @@ audio_output_features = [ video_output_features = [ { + 'name': '--sdl2-video', + 'desc': 'SDL2 video output', + 'deps': 'sdl2', + 'func': check_true, + }, { 'name': '--cocoa', 'desc': 'Cocoa', 'func': check_cocoa -- cgit v1.2.3