From 47d5c83d49fa05173fc62fe13f889480ba89e832 Mon Sep 17 00:00:00 2001 From: Etoh Date: Sat, 5 Aug 2017 15:08:18 +0100 Subject: [PATCH] (mpv chat) Escape/prevent chat when disabling alpha keys --- resources/syncplayintf.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resources/syncplayintf.lua b/resources/syncplayintf.lua index 0948a07..085a3fc 100644 --- a/resources/syncplayintf.lua +++ b/resources/syncplayintf.lua @@ -386,6 +386,7 @@ end -- Set the REPL visibility (`, Esc) function set_active(active) + if use_alpha_rows_for_chat == false then active = false end if active == repl_active then return end if active then repl_active = true @@ -492,12 +493,18 @@ function handle_ins() insert_mode = not insert_mode end +--local was_active_before_tab = false + function handle_tab() use_alpha_rows_for_chat = not use_alpha_rows_for_chat if use_alpha_rows_for_chat then mp.enable_key_bindings('repl-alpha-input') + --set_active(was_active_before_tab) else mp.disable_key_bindings('repl-alpha-input') + --was_active_before_tab = repl_active + --set_active(false) + escape() end end