diff --git a/config.py b/config.py index 9d8d2ae0..e6199231 100644 --- a/config.py +++ b/config.py @@ -400,9 +400,9 @@ class Config: def GITHUB_URL(self): return self._GITHUB_URL - @property - def BREAK_KEYSYM_LIST(self): - return self._BREAK_KEYSYM_LIST + # @property + # def BREAK_KEYSYM_LIST(self): + # return self._BREAK_KEYSYM_LIST @property def MAX_MIC_ENERGY_THRESHOLD(self): @@ -487,10 +487,10 @@ class Config: self._ENABLE_OSC = False self._UPDATE_FLAG = False self._GITHUB_URL = "https://api.github.com/repos/misyaguziya/VRCT/releases/latest" - self._BREAK_KEYSYM_LIST = [ - "Delete", "Select", "Up", "Down", "Next", "End", "Print", - "Prior","Insert","Home", "Left", "Clear", "Right", "Linefeed" - ] + # self._BREAK_KEYSYM_LIST = [ + # "Delete", "Select", "Up", "Down", "Next", "End", "Print", + # "Prior","Insert","Home", "Left", "Clear", "Right", "Linefeed" + # ] self._MAX_MIC_ENERGY_THRESHOLD = 2000 self._MAX_SPEAKER_ENERGY_THRESHOLD = 4000 self._SELECTED_TAB_NO = "1" diff --git a/main.py b/main.py index 27d81c3a..d1a39236 100644 --- a/main.py +++ b/main.py @@ -1,9 +1,6 @@ from threading import Thread -import customtkinter -from vrct_gui import vrct_gui from config import config from model import model -from customtkinter import StringVar from view import view # func transcription send message @@ -103,11 +100,6 @@ def messageBoxPressKeyEnter(e): def messageBoxPressKeyAny(e): model.oscStartSendTyping() - entry_message_box = getattr(vrct_gui, "entry_message_box") - if e.keysym != "??": - if len(e.char) != 0 and e.keysym in config.BREAK_KEYSYM_LIST: - entry_message_box.insert("end", e.char) - return "break" # func select languages def setYourLanguageAndCountry(select): diff --git a/vrct_gui/main_window/widgets/create_entry_message_box.py b/vrct_gui/main_window/widgets/create_entry_message_box.py index 61dfe593..7bdfb491 100644 --- a/vrct_gui/main_window/widgets/create_entry_message_box.py +++ b/vrct_gui/main_window/widgets/create_entry_message_box.py @@ -19,3 +19,17 @@ def createEntryMessageBox(settings, main_window): ) main_window.entry_message_box.grid(row=0, column=0, padx=settings.uism.TEXTBOX_ENTRY_PADX, pady=settings.uism.TEXTBOX_ENTRY_PADY, sticky="nsew") main_window.entry_message_box._entry.grid(padx=settings.uism.TEXTBOX_ENTRY_IPADX, pady=settings.uism.TEXTBOX_ENTRY_IPADY) + + + def messageBoxAnyKeyPress(e): + BREAK_KEYSYM_LIST = [ + "Delete", "Select", "Up", "Down", "Next", "End", "Print", + "Prior","Insert","Home", "Left", "Clear", "Right", "Linefeed" + ] + if e.keysym != "??": + if len(e.char) != 0 and e.keysym in BREAK_KEYSYM_LIST: + main_window.entry_message_box.insert("end", e.char) + return "break" + + main_window.entry_message_box.bind("", messageBoxAnyKeyPress) +