mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 19:06:11 +00:00
Carry the remembered front past the Windows paste as well
The macOS press learned a third argument, the application that was in front when the recording started, and every backend is handed it. SendInput takes no such thing: nothing on Windows moves the front while a recording runs, so the process id arrives and is left alone. Without this the Windows backend refuses the call the shared press makes, and the five key tests in tests.test_paste.Windows stop at a TypeError. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
+4
-1
@@ -488,11 +488,14 @@ class _WinInput(ctypes.Structure):
|
|||||||
_fields_ = [("type", ctypes.c_ulong), ("union", _WinInputUnion)]
|
_fields_ = [("type", ctypes.c_ulong), ("union", _WinInputUnion)]
|
||||||
|
|
||||||
|
|
||||||
def _win_press(shortcut, delay):
|
def _win_press(shortcut, delay, _focus=None):
|
||||||
"""Post the presses and releases straight into the input queue.
|
"""Post the presses and releases straight into the input queue.
|
||||||
|
|
||||||
No permission stands in front of SendInput the way Accessibility does on
|
No permission stands in front of SendInput the way Accessibility does on
|
||||||
macOS: whatever window has focus receives the combination.
|
macOS: whatever window has focus receives the combination.
|
||||||
|
|
||||||
|
Nothing here takes the front from the window being dictated into, so the
|
||||||
|
remembered process id has nothing to hand back to: it is a macOS concern.
|
||||||
"""
|
"""
|
||||||
codes = _win_keys(shortcut)
|
codes = _win_keys(shortcut)
|
||||||
user32, _ = _win_api()
|
user32, _ = _win_api()
|
||||||
|
|||||||
Reference in New Issue
Block a user