mpv/osdep
wm4 602384348e terminal: attempt to handle the ESC key
Due to Unix being legacy garbage, it's not possible to safely detect the
ESC key on terminal. The key sequences are ambiguous. The code for the
ESC key also starts the sequences for other special keys.

Until now, you needed to hit ESC twice for it to be recognized.

Attempt to handle this better by using a timeout to detect the key. If
ESC is in the input buffer, but nothing else arrived after a timeout,
assume it's the ESC key. I think this is the method vim uses. Currently,
the timeout is set at 100ms. This is hardcoded and cannot be changed.
It's possible that this causes problems on slow ssh connections or so.

I'm not sure what exactly happens if you manage to get ESC + another
normal key into the input buffer. If it's a known sequence, it will be
matched and interpreted as such. If not, it'll probably be discarded.
2020-09-17 15:31:19 +02:00
..
android osdep: remove posix_spawn() helpers and wrappers 2020-05-15 16:37:41 +02:00
macos mac: use config cache und wakeup for mac option runtime changes 2020-08-22 14:22:49 +02:00
win32 win32: pthread: define PTHREAD_MUTEX_ERRORCHECK 2020-03-19 00:11:23 +01:00
atomic.h atomic: add atomic_exchange_explicit() fallback 2020-03-05 22:00:50 +01:00
compiler.h osdep: add portable C11-like alignof() macro 2018-05-24 19:56:35 +02:00
endian.h
getpid.h lua+js: Implement utils.getpid() 2018-02-13 20:16:01 -08:00
glob-win.c Universal Windows Plaform (UWP) support 2017-06-29 10:36:16 +02:00
io.c win32: scripting utils.get_env_list(): use UTF-8 2020-08-16 12:24:19 +03:00
io.h win32: scripting utils.get_env_list(): use UTF-8 2020-08-16 12:24:19 +03:00
macOS_swift_bridge.h mac: replace old event tap for media key support with MediaPlayer 2019-12-15 20:07:31 +01:00
macosx_application.h cocoa-cb: add support for forcing the dedicated GPU for rendering 2020-01-26 12:12:22 +01:00
macosx_application.m build: change filenames of generated files 2020-06-04 16:59:05 +02:00
macosx_application_objc.h mac: fix media key support for libmpv users 2020-02-22 13:56:31 +01:00
macosx_compat.h mac: add missing semicolon to macosx_compat.h 2019-01-26 20:44:36 +01:00
macosx_events.h mac: remove Apple Remote support 2019-12-15 20:07:31 +01:00
macosx_events.m mac: fix media key support for libmpv users 2020-02-22 13:56:31 +01:00
macosx_events_objc.h mac: fix media key support for libmpv users 2020-02-22 13:56:31 +01:00
macosx_menubar.h osx: move menu bar creation into its own file 2017-08-18 19:20:41 +02:00
macosx_menubar.m mac: activate logging when started from the bundle 2020-02-08 10:55:07 +01:00
macosx_menubar_objc.h osx: refactor menu bar creation 2017-08-18 19:20:41 +02:00
macosx_touchbar.h osx: change license of OSX and cocoa files to LGPL 2017-06-24 16:29:22 +02:00
macosx_touchbar.m osx: change license of OSX and cocoa files to LGPL 2017-06-24 16:29:22 +02:00
macosx_versions.h osx: change license of OSX and cocoa files to LGPL 2017-06-24 16:29:22 +02:00
main-fn-cocoa.c build: move main-fn files to osdep 2015-05-02 18:59:58 +02:00
main-fn-unix.c build: move main-fn files to osdep 2015-05-02 18:59:58 +02:00
main-fn-win.c win32: remove -municode from mpv binary 2019-09-19 20:37:05 +02:00
main-fn.h build: move main-fn files to osdep 2015-05-02 18:59:58 +02:00
mpv.exe.manifest win32: request the UTF-8 code page for Windows APIs 2020-08-08 15:00:25 +03:00
mpv.rc build: change filenames of generated files 2020-06-04 16:59:05 +02:00
path-macosx.m osx: fix bundle on macOS High Sierra (10.13) 2017-10-03 11:30:56 +02:00
path-unix.c path: switch back to using non-XDG config dir by default 2020-06-25 17:56:16 +02:00
path-uwp.c Universal Windows Plaform (UWP) support 2017-06-29 10:36:16 +02:00
path-win.c path: do not use old_home for win32 exe dir 2020-06-25 17:56:16 +02:00
path.h Universal Windows Plaform (UWP) support 2017-06-29 10:36:16 +02:00
polldev.c osdep: add poll shim for macOS 2017-12-09 21:11:46 +02:00
polldev.h osdep: add poll shim for macOS 2017-12-09 21:11:46 +02:00
semaphore.h
semaphore_osx.c Fix use of ISC license 2017-04-15 16:20:00 +02:00
strnlen.h osdep: make use of HAVE_ANDROID 2018-08-20 17:16:22 +02:00
subprocess-dummy.c command: extend subprocess command 2020-07-20 21:02:17 +02:00
subprocess-posix.c command: extend subprocess command stdin, change behavior 2020-08-16 02:54:44 +02:00
subprocess-win.c subprocess-win: update to mp_subprocess2 2020-07-20 21:02:17 +02:00
subprocess.c command: extend subprocess command 2020-07-20 21:02:17 +02:00
subprocess.h command: extend subprocess command stdin, change behavior 2020-08-16 02:54:44 +02:00
terminal-dummy.c build: change how some OS specific source files are selected 2017-06-29 10:30:16 +02:00
terminal-unix.c terminal: attempt to handle the ESC key 2020-09-17 15:31:19 +02:00
terminal-win.c subprocess-win: update to mp_subprocess2 2020-07-20 21:02:17 +02:00
terminal.h terminal: remove unused return value 2017-06-27 18:08:56 +02:00
threads.c build: restore BSD thread names after 9f461b85bf 2020-04-23 13:58:16 +02:00
threads.h osdep: add a pthread debugging wrapper 2020-03-18 22:42:13 +01:00
timer-darwin.c
timer-linux.c build: remove nanosleep() check 2017-12-02 23:29:40 +01:00
timer-win2.c Universal Windows Plaform (UWP) support 2017-06-29 10:36:16 +02:00
timer.c timer: remove an unused helper function 2018-05-24 19:56:35 +02:00
timer.h demux, stream: readd cache-speed in some other form 2018-12-06 10:30:41 +01:00
w32_keyboard.c w32_common: handle media keys 2017-08-05 02:38:44 +10:00
w32_keyboard.h w32_common: handle media keys 2017-08-05 02:38:44 +10:00
win32-console-wrapper.c win32-console-wrapper: silence missing prototype warnings 2019-05-10 21:06:58 +10:00
windows_utils.c subprocess-win: update to mp_subprocess2 2020-07-20 21:02:17 +02:00
windows_utils.h subprocess-win: update to mp_subprocess2 2020-07-20 21:02:17 +02:00