view.pyへの分離完了(messageBoxPressKeyAnyをgui内部に移動、使わなくなったconfig.pyのBREAK_KEYSYM_LISTは一旦コメントアウト)

This commit is contained in:
Sakamoto Shiina
2023-08-31 00:43:10 +09:00
parent fde7ea6a75
commit be5a0e386f
3 changed files with 21 additions and 15 deletions

View File

@@ -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"

View File

@@ -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):

View File

@@ -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("<Any-KeyPress>", messageBoxAnyKeyPress)