How can i call function with ahk hotkey? #159
-
Not worked. |
Beta Was this translation helpful? Give feedback.
Answered by
spyoungtech
May 3, 2023
Replies: 1 comment 1 reply
-
Right now, there is no functionality to call Python functions as the result of a hotkey being triggered. Right now, only AHK scripts are supported as callbacks for hotkeys. As described in the Readme: from ahk import AHK, Hotkey
ahk = AHK()
key_combo = '#n' # Define an AutoHotkey key combonation
script = 'Run Notepad' # Define an ahk script
hotkey = Hotkey(ahk, key_combo, script) # Create Hotkey
hotkey.start() # Start listening for hotkey Support for Python callbacks is planned for the future. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python callbacks are now supported in v1!
Hint: for adding arguments to the callback function, use
lambda
orfunctools.partial
, or similar.