DllCall implemented? #154
-
has this been implemented? I found using AHK DllCall("mouse_event", uint, 1, int, MoveX * 5, int, MoveY, uint, 0, int, 0) works better than python mouse_move. Might be crazy but I feel like it works better Could this be implemented? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Several functionalities from AHK are omitted from the library because Python has similar functionality in the standard library. For example, AHK's Process functionality is omitted because Python has a Similarly, it's possible to work with DLLs directly in Python using the ctypes library: https://docs.python.org/3/library/ctypes.html I suppose you might do something like this using ctypes: from ctypes import windll
windll.user32.mouse_event(...) Of course if you find it easier to work with AHK, you can always use script = 'DllCall("mouse_event", uint, 1, int, MoveX * 5, int, MoveY, uint, 0, int, 0)'
ahk.run_script(script) Or even build this into your own subclass of AHK if you'd like and override the mouse_move method if it works better for you. from ahk import AHK
class MyAHK(AHK):
def mouse_move(self, ...):
script = ...
self.run_script(script)
ahk = MyAHK()
ahk.mouse_move(...) |
Beta Was this translation helpful? Give feedback.
Several functionalities from AHK are omitted from the library because Python has similar functionality in the standard library. For example, AHK's Process functionality is omitted because Python has a
subprocess
module.Similarly, it's possible to work with DLLs directly in Python using the ctypes library: https://docs.python.org/3/library/ctypes.html
For that reason,
DllCall
from AHK is not implemented.I suppose you might do something like this using ctypes:
Of course if you find it easier to work with AHK, you can always use
run_script
from the python library. Though, it seems like an extra unnecessary layer.