mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-28 08:04:13 +08:00
issues/645
This commit is contained in:
parent
7841368a1f
commit
a41ae5252d
@ -46,6 +46,7 @@ def setTab_quick_direct(self):
|
||||
windows.RegisterWindowMessage("Magpie_Core_CLI_Message_ToggleOverlay"),
|
||||
),
|
||||
"_26": gobject.baseobject.translation_ui.ocr_once_signal.emit,
|
||||
"_27": gobject.baseobject.translation_ui.simulate_key_enter,
|
||||
}
|
||||
for name in globalconfig["quick_setting"]["all"]:
|
||||
if name not in self.bindfunctions:
|
||||
|
@ -390,15 +390,16 @@ class QUnFrameWindow(resizableframeless):
|
||||
|
||||
rangeselct_function(self, ocroncefunction, False, False)
|
||||
|
||||
def addbuttons(self):
|
||||
def simulate_key_enter():
|
||||
windows.SetForegroundWindow(gobject.baseobject.textsource.hwnd)
|
||||
time.sleep(0.1)
|
||||
while windows.GetForegroundWindow() == gobject.baseobject.textsource.hwnd:
|
||||
time.sleep(0.001)
|
||||
windows.keybd_event(13, 0, 0, 0)
|
||||
windows.keybd_event(13, 0, windows.KEYEVENTF_KEYUP, 0)
|
||||
@threader
|
||||
def simulate_key_enter(self):
|
||||
windows.SetForegroundWindow(gobject.baseobject.textsource.hwnd)
|
||||
time.sleep(0.1)
|
||||
while windows.GetForegroundWindow() == gobject.baseobject.textsource.hwnd:
|
||||
time.sleep(0.001)
|
||||
windows.keybd_event(13, 0, 0, 0)
|
||||
windows.keybd_event(13, 0, windows.KEYEVENTF_KEYUP, 0)
|
||||
|
||||
def addbuttons(self):
|
||||
def simulate_key_ctrl():
|
||||
windows.SetForegroundWindow(gobject.baseobject.textsource.hwnd)
|
||||
time.sleep(0.1)
|
||||
@ -469,7 +470,7 @@ class QUnFrameWindow(resizableframeless):
|
||||
),
|
||||
(
|
||||
"simulate_key_enter",
|
||||
lambda: threading.Thread(target=simulate_key_enter).start(),
|
||||
self.simulate_key_enter,
|
||||
),
|
||||
(
|
||||
"copy_once",
|
||||
|
@ -571,6 +571,11 @@
|
||||
"use": false,
|
||||
"name": "进行一次OCR",
|
||||
"keystring": ""
|
||||
},
|
||||
"_27": {
|
||||
"use": false,
|
||||
"name": "模拟按键Enter",
|
||||
"keystring": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user