diff --git a/resources/syncplayintf.lua b/resources/syncplayintf.lua index e678578..6902c2a 100644 --- a/resources/syncplayintf.lua +++ b/resources/syncplayintf.lua @@ -339,7 +339,8 @@ opts = { -- ['inputPromptCharacter'] = ">", --Lang: - ['mpv-key-hint'] = "[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode.", + ['mpv-key-tab-hint'] = "[TAB] to toggle access to alphabet row key shortcuts.", + ['mpv-key-hint'] = "[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.", } @@ -444,6 +445,9 @@ function input_ass() end local osd_help_message = opts['mpv-key-hint'] + if opts['chatDirectInput'] then + osd_help_message = opts['mpv-key-tab-hint'] .. " " .. osd_help_message + end local help_prompt = '\n{\\an'..alignment..'\\pos('..secondary_pos..')\\fn' .. opts['chatOutputFontFamily'] .. '\\fs' .. (opts['chatInputFontSize']/1.25) .. '\\1c&H'..HINT_TEXT_COLOUR..'}' .. osd_help_message local firststyle = "{\\an"..alignment.."}{\\pos("..position..")}" @@ -623,7 +627,7 @@ 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 + if key_hints_enabled and (string.len(line) > 0 or opts['chatDirectInput'] == false) then key_hints_enabled = false end set_active(true) @@ -927,12 +931,12 @@ function set_syncplayintf_options(input) opt.read_options(user_opts, "osc") default_oscvisibility_state = user_opts.visibility if opts['chatInputEnabled'] == true then + key_hints_enabled = true mp.add_forced_key_binding('enter', handle_enter) mp.add_forced_key_binding('kp_enter', handle_enter) if opts['chatDirectInput'] == true then add_repl_alpharow_bindings(alpharowbindings) mp.add_forced_key_binding('tab', handle_tab) - key_hints_enabled = true end end end \ No newline at end of file diff --git a/syncplay/constants.py b/syncplay/constants.py index f59c0c3..48599cd 100644 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -197,7 +197,7 @@ MPV_SYNCPLAYINTF_OPTIONS_TO_SEND = ["chatInputEnabled","chatInputFontFamily", "c "notificationTimeout","alertTimeout","chatTimeout","chatOutputEnabled"] MPV_SYNCPLAYINTF_CONSTANTS_TO_SEND = ["MaxChatMessageLength={}".format(MAX_CHAT_MESSAGE_LENGTH),u"inputPromptStartCharacter={}".format(MPV_INPUT_PROMPT_START_CHARACTER),u"inputPromptEndCharacter={}".format(MPV_INPUT_PROMPT_END_CHARACTER)] -MPV_SYNCPLAYINTF_LANGUAGE_TO_SEND = ["mpv-key-hint", "alphakey-mode-warning-first-line", "alphakey-mode-warning-second-line"] +MPV_SYNCPLAYINTF_LANGUAGE_TO_SEND = ["mpv-key-tab-hint","mpv-key-hint", "alphakey-mode-warning-first-line", "alphakey-mode-warning-second-line"] VLC_SLAVE_ARGS = ['--extraintf=luaintf', '--lua-intf=syncplay', '--no-quiet', '--no-input-fast-seek', '--play-and-pause', '--start-time=0'] VLC_SLAVE_MACOS_ARGS = ['--verbose=2', '--no-file-logging'] diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 28fb671..5f729b9 100644 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -251,7 +251,8 @@ 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.",# TODO: Translate + "mpv-key-tab-hint": u"[TAB] to toggle access to alphabet row key shortcuts.", # TODO: Translate + "mpv-key-hint": u"[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 diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index 4f0faa6..f1926b4 100644 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -256,7 +256,8 @@ 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.", + "mpv-key-tab-hint": u"[TAB] to toggle access to alphabet row key shortcuts.", + "mpv-key-hint": u"[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.", diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 3c6b61c..0311f3c 100644 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -260,7 +260,8 @@ 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.", # TODO: Translate + "mpv-key-tab-hint": u"[TAB] to toggle access to alphabet row key shortcuts.", # TODO: Translate + "mpv-key-hint": u"[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