From 67a9c04844bb63eb0b48215bf9c437c037c84832 Mon Sep 17 00:00:00 2001 From: Etoh Date: Fri, 29 Dec 2017 13:59:02 +0000 Subject: [PATCH] Hide mpv chat help prompt when second character entered --- resources/syncplayintf.lua | 5 ++++- syncplay/messages_de.py | 6 +++--- syncplay/messages_en.py | 6 +++--- syncplay/messages_ru.py | 6 +++--- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/resources/syncplayintf.lua b/resources/syncplayintf.lua index 44e45cb..e678578 100644 --- a/resources/syncplayintf.lua +++ b/resources/syncplayintf.lua @@ -339,7 +339,7 @@ opts = { -- ['inputPromptCharacter'] = ">", --Lang: - ['mpv-key-hint'] = "[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode. This hint disappears after you send a message.", + ['mpv-key-hint'] = "[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode.", ['alphakey-mode-warning-first-line'] = "You can temporarily use old mpv bindings with a-z keys.", ['alphakey-mode-warning-second-line'] = "Press [TAB] to return to Syncplay chat mode.", } @@ -623,6 +623,9 @@ end -- Insert a character at the current cursor position (' '-'~', Shift+Enter) function handle_char_input(c) + if key_hints_enabled and string.len(line) > 0 then + key_hints_enabled = false + end set_active(true) if insert_mode then line = line:sub(1, cursor - 1) .. c .. line:sub(next_utf8(line, cursor)) diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 2f19dd8..28fb671 100644 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -237,7 +237,7 @@ de = { "chat-title": u"Chat message input", # TODO: Translate "chatinputenabled-label": u"Enable chat input via mpv (using enter key)", # TODO: Translate - "chatdirectinput-label" : u"Enable instant chat input (bypass having to press enter key to chat)", # TODO: Translate + "chatdirectinput-label" : u"Allow instant chat input (bypass having to press enter key to chat)", # TODO: Translate "chatinputfont-label": u"Chat input font", # TODO: Translate "chatfont-label": u"Set font", # TODO: Translate "chatcolour-label": u"Set colour", # TODO: Translate @@ -251,7 +251,7 @@ de = { "chat-chatroom-option": u"Chatroom style", # TODO: Translate "chat-scrolling-option": u"Scrolling style", # TODO: Translate - "mpv-key-hint": u"[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode. This hint disappears after you send a message.",# TODO: Translate + "mpv-key-hint": u"[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode.",# TODO: Translate "alphakey-mode-warning-first-line": u"You can temporarily use old mpv bindings with a-z keys.", # TODO: Translate "alphakey-mode-warning-second-line": u"Press [TAB] to return to Syncplay chat mode.", # TODO: Translate @@ -379,7 +379,7 @@ de = { "trusteddomains-arguments-tooltip" : u"Domains that it is okay for Syncplay to automatically switch to when shared playlists is enabled.", # TODO: Translate into German "chatinputenabled-tooltip": u"Enable chat input in mpv (press enter to chat, enter to send, escape to cancel)", # TODO: Translate - "chatdirectinput-tooltip" : u"Skip having to press 'enter' to go into chat input mode in mpv.", # TODO: Translate + "chatdirectinput-tooltip" : u"Skip having to press 'enter' to go into chat input mode in mpv. Press TAB in mpv to temporarily disable this feature.", # TODO: Translate "font-label-tooltip": u"Font used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.", # TODO: Translate "set-input-font-tooltip": u"Font family used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.", # TODO: Translate "set-input-colour-tooltip": u"Font colour used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.", # TODO: Translate diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index d852a25..4f0faa6 100644 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -242,7 +242,7 @@ en = { "chat-title" : u"Chat message input", "chatinputenabled-label" : u"Enable chat input via mpv", - "chatdirectinput-label" : u"Enable instant chat input (bypass having to press enter key to chat)", + "chatdirectinput-label" : u"Allow instant chat input (bypass having to press enter key to chat)", "chatinputfont-label" : u"Chat input font", "chatfont-label" : u"Set font", "chatcolour-label" : u"Set colour", @@ -256,7 +256,7 @@ en = { "chat-chatroom-option": u"Chatroom style", "chat-scrolling-option": u"Scrolling style", - "mpv-key-hint": u"[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode. This hint disappears after you send a message.", + "mpv-key-hint": u"[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode.", "alphakey-mode-warning-first-line": u"You can temporarily use old mpv bindings with a-z keys.", "alphakey-mode-warning-second-line": u"Press [TAB] to return to Syncplay chat mode.", @@ -382,7 +382,7 @@ en = { "trusteddomains-arguments-tooltip" : u"Domains that it is okay for Syncplay to automatically switch to when shared playlists is enabled.", "chatinputenabled-tooltip" : u"Enable chat input in mpv (press enter to chat, enter to send, escape to cancel)", - "chatdirectinput-tooltip" : u"Skip having to press 'enter' to go into chat input mode in mpv.", + "chatdirectinput-tooltip" : u"Skip having to press 'enter' to go into chat input mode in mpv. Press TAB in mpv to temporarily disable this feature.", "font-label-tooltip" : u"Font used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.", "set-input-font-tooltip" : u"Font family used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.", "set-input-colour-tooltip" : u"Font colour used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.", diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 3670df8..3c6b61c 100644 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -246,7 +246,7 @@ ru = { "chat-title": u"Chat message input", # TODO: Translate "chatinputenabled-label": u"Enable chat input via mpv (using enter key)", # TODO: Translate - "chatdirectinput-label" : u"Enable instant chat input (bypass having to press enter key to chat)", # TODO: Translate + "chatdirectinput-label" : u"Allow instant chat input (bypass having to press enter key to chat)", # TODO: Translate "chatinputfont-label": u"Chat input font", # TODO: Translate "chatfont-label": u"Set font", # TODO: Translate "chatcolour-label": u"Set colour", # TODO: Translate @@ -260,7 +260,7 @@ ru = { "chat-chatroom-option": u"Chatroom style", # TODO: Translate "chat-scrolling-option": u"Scrolling style", # TODO: Translate - "mpv-key-hint": u"[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode. This hint disappears after you send a message.", # TODO: Translate + "mpv-key-hint": u"[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode.", # TODO: Translate "alphakey-mode-warning-first-line": u"You can temporarily use old mpv bindings with a-z keys.", # TODO: Translate "alphakey-mode-warning-second-line": u"Press [TAB] to return to Syncplay chat mode.", # TODO: Translate @@ -385,7 +385,7 @@ ru = { "trusteddomains-arguments-tooltip" : u"Сайты, которые разрешены для автоматического воспроизведения из общего списка воспроизведения.", "chatinputenabled-tooltip": u"Enable chat input in mpv (press enter to chat, enter to send, escape to cancel)",# TODO: Translate - "chatdirectinput-tooltip" : u"Skip having to press 'enter' to go into chat input mode in mpv.", # TODO: Translate + "chatdirectinput-tooltip" : u"Skip having to press 'enter' to go into chat input mode in mpv. Press TAB in mpv to temporarily disable this feature.", # TODO: Translate "font-label-tooltip": u"Font used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.",# TODO: Translate "set-input-font-tooltip": u"Font family used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.",# TODO: Translate "set-input-colour-tooltip": u"Font colour used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.",# TODO: Translate