Skip to content

Commit

Permalink
Fix an issue with the SAPI 5 engine's mimic method
Browse files Browse the repository at this point in the history
Re: #381.

Using the MSG and POINT structures from ctypes.wintypes, rather than
defining them ourselves, makes the engine's `mimic' method function
correctly on 64-bit Python.
  • Loading branch information
drmfinlay committed Oct 19, 2023
1 parent 05bd218 commit 5765e72
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions dragonfly/engines/backend_sapi5/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@

import pythoncom
from datetime import datetime
from ctypes import Structure, c_long, c_int, c_uint, pointer
from ctypes import windll, WinError, WINFUNCTYPE
from ctypes.wintypes import DWORD, HANDLE, HWND, LONG
from ctypes import c_int, pointer, windll, WinError, WINFUNCTYPE
from ctypes.wintypes import MSG, POINT, DWORD, HANDLE, HWND, LONG

import win32con
from six import string_types, integer_types
Expand All @@ -55,18 +54,6 @@

#===========================================================================

class POINT(Structure):
_fields_ = [('x', c_long),
('y', c_long)]

class MSG(Structure):
_fields_ = [('hwnd', c_int),
('message', c_uint),
('wParam', c_int),
('lParam', c_int),
('time', c_int),
('pt', POINT)]


class MimicObserver(RecognitionObserver):
_log = logging.getLogger("SAPI5 RecObs")
Expand Down

0 comments on commit 5765e72

Please sign in to comment.