0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00
mpv/osdep
wm4 4b5c3ea7a7 terminal-unix: new input handling code
This is independent of terminfo/termcap, and supports more keys.
Originally, the goal was just extending the set of supported key
sequences, but since the terminfo stuff actually makes this much harder,
and since it's a big blob of bloated legacy crap, just drop it. Instead,
use hardcoded tables.

It's pretty easy to get on the same level as the old code (with fewer
LOC), and we avoid additional error situations, such as mallocs which
could fail (the old code just ignores malloc failures). We also try to
support some xterm escape sequences, which are in relatively widespread
use. (I'm not sure about the urxvt ones.)

Trying to deal with xterm shift/ctrl/alt modifiers is probably a bit
overcomplicated, and only deals with prefixes - xterm randomly uses
prefix sequences for some keys, and suffixes for others (what the heck).

Additionally, try to drop unknown escape codes. This basically relies
on a trick: in almost 100% of all situations, a read() call will
actually return complete sequences (possibly because of pipe semantics
and atomic writes from the terminal emulator?), so it's easy to drop
unknown sequences. This prevents that they trigger random key bindings
as the code interprets the part after ESC as normal keys.

This also drops the use of terminfo for sending smkx/rmkx. It seems
even vt100 (to which virtually everything non-legacy is reasonably
compatible with) supports the codes we hardcode, so it should be fine.

This commit actually changes only the code if terminfo/termcap are not
found. The next commit will make this code default.
2014-08-21 22:45:58 +02:00
..
ar Kill all tabs 2014-04-13 18:03:01 +02:00
endian.h build: deal with endian mess 2014-07-10 00:58:56 +02:00
glob-win.c glob-win: support Unicode 2014-04-21 02:57:16 +02:00
io.c win32: emulate some ANSI terminal escape codes 2014-08-21 22:45:58 +02:00
io.h input: separate wakeup pipe creation into a separate function 2014-05-30 02:16:20 +02:00
macosx_application_objc.h cocoa: move handleFilesArray: to macosx_events 2014-08-06 09:31:58 +02:00
macosx_application.h cocoa: move set_input_context to macosx_events 2014-08-06 09:31:58 +02:00
macosx_application.m cocoa: move handleFilesArray: to macosx_events 2014-08-06 09:31:58 +02:00
macosx_compat.h cocoa: fix compilation on OS X 10.8 2014-07-14 07:21:44 +02:00
macosx_events_objc.h cocoa: move handleFilesArray: to macosx_events 2014-08-06 09:31:58 +02:00
macosx_events.h cocoa: move set_input_context to macosx_events 2014-08-06 09:31:58 +02:00
macosx_events.m cocoa: move handleFilesArray: to macosx_events 2014-08-06 09:31:58 +02:00
macosx_versions.h cocoa: fix compilation on OS X 10.8 2014-07-14 07:21:44 +02:00
mpv.exe.manifest win32: edit resource files, in particular set CompanyName 2013-09-23 01:44:09 +02:00
mpv.rc Update copyright year 2014-01-01 00:00:00 +01:00
numcores.c vd_ffmpeg: set thread count to number of cores on machine by default 2010-12-20 05:53:28 +02:00
numcores.h vd_ffmpeg: set thread count to number of cores on machine by default 2010-12-20 05:53:28 +02:00
path-macosx.m config: use the same signature for win32/OSX specific path functions 2014-06-26 19:56:45 +02:00
path-win.c config: use the same signature for win32/OSX specific path functions 2014-06-26 19:56:45 +02:00
path.h config: use the same signature for win32/OSX specific path functions 2014-06-26 19:56:45 +02:00
terminal-unix.c terminal-unix: new input handling code 2014-08-21 22:45:58 +02:00
terminal-win.c terminal-win: read input from a thread 2014-08-21 22:45:58 +02:00
terminal.h terminal: some cleanups 2014-08-21 22:45:58 +02:00
threads.c threads: use mpv time for mpthread_cond_timedwait wrapper 2014-05-18 19:20:32 +02:00
threads.h threads: use mpv time for mpthread_cond_timedwait wrapper 2014-05-18 19:20:32 +02:00
timer-darwin.c Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00
timer-linux.c timer: reduce ifdef headsplitting-factor 2014-03-09 16:58:00 +01:00
timer-win2.c timer: init only once 2014-02-10 01:12:34 +01:00
timer.c timer: remove unneeded time_t overflow check 2014-05-24 16:17:45 +02:00
timer.h threads: use mpv time for mpthread_cond_timedwait wrapper 2014-05-18 19:20:32 +02:00
w32_keyboard.c w32: use the w32_common keymap in terminal-win too 2014-01-19 14:42:15 +01:00
w32_keyboard.h w32: use the w32_common keymap in terminal-win too 2014-01-19 14:42:15 +01:00
win32-console-wrapper.c win32-console-wrapper: use child process exit code 2014-01-06 13:31:15 +01:00