👍️[Update] Model : messagebox send/typing/typing_stopを追加

This commit is contained in:
misyaguziya
2024-09-02 12:05:27 +09:00
parent 1f5a27343d
commit 5697f3273f
2 changed files with 12 additions and 6 deletions

View File

@@ -349,16 +349,20 @@ class ChatMessage:
}, },
} }
def callbackMessageBoxPressKeyEnter(data, action, *args, **kwargs) -> dict: def callbackMessageBoxSend(data, action, *args, **kwargs) -> dict:
chat = ChatMessage(action) chat = ChatMessage(action)
response = chat.send(data) response = chat.send(data)
return response return response
def messageBoxPressKeyAny(e): def callbackMessageBoxTyping(*args, **kwargs) -> dict:
if config.ENABLE_SEND_MESSAGE_TO_VRC is True: if config.ENABLE_SEND_MESSAGE_TO_VRC is True:
model.oscStartSendTyping() model.oscStartSendTyping()
else: return {"status":200}
def callbackMessageBoxTypingStop(*args, **kwargs) -> dict:
if config.ENABLE_SEND_MESSAGE_TO_VRC is True:
model.oscStopSendTyping() model.oscStopSendTyping()
return {"status":200}
def messageBoxFocusIn(e): def messageBoxFocusIn(e):
# view.foregroundOffIfForegroundEnabled() # view.foregroundOffIfForegroundEnabled()

View File

@@ -109,7 +109,9 @@ controller_mapping = {
"/controller/callback_disable_transcription_send": controller.callbackDisableTranscriptionSend, "/controller/callback_disable_transcription_send": controller.callbackDisableTranscriptionSend,
"/controller/callback_enable_transcription_receive": controller.callbackEnableTranscriptionReceive, "/controller/callback_enable_transcription_receive": controller.callbackEnableTranscriptionReceive,
"/controller/callback_disable_transcription_receive": controller.callbackDisableTranscriptionReceive, "/controller/callback_disable_transcription_receive": controller.callbackDisableTranscriptionReceive,
"/controller/callback_messagebox_press_key_enter": controller.callbackMessageBoxPressKeyEnter, "/controller/callback_messagebox_send": controller.callbackMessageBoxSend,
"/controller/callback_messagebox_typing": controller.callbackMessageBoxTyping,
"/controller/callback_messagebox_typing_stop": controller.callbackMessageBoxTypingStop,
"/controller/callback_enable_foreground": controller.callbackEnableForeground, "/controller/callback_enable_foreground": controller.callbackEnableForeground,
"/controller/callback_disable_foreground": controller.callbackDisableForeground, "/controller/callback_disable_foreground": controller.callbackDisableForeground,
"/controller/set_your_language_and_country": controller.setYourLanguageAndCountry, "/controller/set_your_language_and_country": controller.setYourLanguageAndCountry,
@@ -231,7 +233,7 @@ action_mapping = {
"stopped":"/action/check_speaker_threshold_energy_stopped", "stopped":"/action/check_speaker_threshold_energy_stopped",
"error_device":"/action/error_device", "error_device":"/action/error_device",
}, },
"/controller/callback_messagebox_press_key_enter": { "/controller/callback_messagebox_send": {
"error_translation_engine":"/action/error_translation_engine" "error_translation_engine":"/action/error_translation_engine"
}, },
"/controller/callback_download_ctranslate2_weight": { "/controller/callback_download_ctranslate2_weight": {
@@ -370,7 +372,7 @@ if __name__ == "__main__":
printLog("endpoint", endpoint) printLog("endpoint", endpoint)
match endpoint: match endpoint:
case "/controller/callback_messagebox_press_key_enter": case "/controller/callback_messagebox_send":
data = {"id":"123456", "message":encodeUtf8("テスト")} data = {"id":"123456", "message":encodeUtf8("テスト")}
case "/controller/set_your_language_and_country": case "/controller/set_your_language_and_country":
data = {"language": "English", "country": "Hong Kong"} data = {"language": "English", "country": "Hong Kong"}