Available Methods

Most methods from autohotkey are implemented in this wrapper. This page can serve as a quick reference to find Python equivalents of AutoHotkey commands/functions that are implemented in the wrapper.

Methods that are not implemented are also noted here for reference. This is a work in progress and may not list all [un]available methods. Check the full API reference for more complete information.

Mouse and Keyboard

AutoHotkey Command

Status

Notes

#KeyHistory

Not Implemented

BlockInput

Implemented

block_input()

Click

Implemented

click()

Send

Implemented

send() / send_raw() / send_input()

ControlClick

Implemented

control_click() / click() (Window method)

ControlSend[Raw]

Implemented

control_send() / send()

CoordMode

Implemented

set_coord_mode() (or as a parameter to methods affected by the coord mode)

GetKeyName()

Not Implemented

GetKeySC()

Not Implemented

GetKeyState

Implemented

key_state()

GetKeyVK()

Not Implemented

KeyHistory

Not Implemented

KeyWait

Implemented

key_wait()

Input

Not Implemented

Use python input() instead

InputHook()

Not Implemented

MouseClick

Implemented

click()

MouseClickDrag

Implemented

mouse_drag()

MouseGetPos

Implemented

get_mouse_position() / mouse_position

MouseMove

Implemented

mouse_move()

SendLevel

Implemented

set_send_level()

SendMode

Implemented

set_send_mode()

SetCapsLockState

Implemented

set_capslock_state()

SetDefaultMouseSpeed

Implemented

Speed is controlled by the speed keyword argument of relevant methods (for example, see mouse_move())

SetKeyDelay

Implemented

Delay is controlled by the delay keyword argument of relevant methods

SetMouseDelay

Not Implemented

Delays between mouse movements can be controlled in Python code between calls to mouse_move

SetNumLockState

Not Implemented

SetScrollLockState

Not Implemented

SetStoreCapsLockMode

Not Implemented

Hotkeys

AutoHotkey Command

Status

Notes

Hotkeys

Implemented

Before 1.0, callbacks were only supported as Autohotkey Scripts
In 1.0 and later, callbacks are supported as Python functions

Hotstrings

Implemented

Available in 1.0+

Suspend

Implemented*

Use stop_hotkeys and start_hotkeys to enable/disable hotkeys

ClipBoard

AutoHotkey Command

Status

Notes

OnClipboardChange()

Implemented

on_clipboard_change()

Clipboard/ClipboardAll

Implemented

get_clipboard() / set_clipboard() / get_clipboard_all() / set_clipboard_all()

ClipWait

Implemented

clip_wait()

Screen/Image

AutoHotkey Command

Status

Notes

ImageSearch

Implemented

image_search()

PixelGetColor

Implemented

pixel_get_color()

PixelSearch

Implemented

pixel_search()

Registry

AutoHotkey Command

Status

Notes

RegDelete

Implemented

reg_delete()

RegRead

Implemented

reg_read()

RegWrite

Implemented

reg_write()

SetRegView

Not Implemented

Window

Window | Controls

AutoHotkey Command

Status

Notes

Control

Implemented

ControlClick

Implemented

click() (uses control_click())

ControlFocus

Not Implemented

ControlGet

Implemented

ControlGetFocus

Not Implemented

ControlGetPos

Implemented

ControlGetText

Implemented

ControlMove

Implemented

ControlSend[Raw]

Implemented

ControlSetText

Implemented

Menu

Not Implemented

PostMessage/SendMessage

Not Implemented

SetControlDelay

Not Implemented

WinMenuSelectItem

Not Implemented

Window | Groups

AutoHotkey Command

Status

Notes

GroupActivate

GroupAdd

GroupClose

GroupDeactivate

Window functions

AutoHotkey Command

Status

Notes

#WinActivateForce

Implemented

Any directive can be added to the daemon

DetectHiddenText

Planned

DetectHiddenWindows

Implemented

Use detect_hidden_windows parameter of relevant functions or set_detect_hidden_windows()

IfWin[Not]Active

Not Implemented

Use Python if with win_active/win.is_active

IfWin[Not]Exist

Not Implemented

Use Python if with win_exists/win.exists

SetTitleMatchMode

Implemented

SetWinDelay

Not Implemented

Delays can be controlled in Python code

StatusBarGetText

Not Implemented

StatusBarWait

Not Implemented

WinActivate

Implemented

win_activate() / activate() (Window method)

WinActivateBottom

Implemented

WinActive()

Implemented

activate() (Window method)

WinClose

Implemented

win_close() / close() (Window method)

WinExist()

Implemented

win_exist() / exists() (Window method)

WinGet

Implemented

win_get() See also find_windows() and variants.

WinGetActiveStats

Not Implemented

WinGetActiveTitle

Not Implemented

Use get_active_window() and title property

WinGetClass

Implemented

win_get_class() / get_class() (Window method)

WinGetPos

Implemented

win_get_position() / get_position() (Window method)

WinGetText

Implemented

win_get_text() / get_text() (Window method)

WinGetTitle

Implemented

win_get_title() / get_title() or title (Window)

WinHide

Implemented

win_hide() / hide() (Window)

WinKill

Implemented

win_kill() / kill() (Window)

WinMaximize

Implemented

win_maximize() / maximize() (Window)

WinMinimize

Implemented

win_minimize() / minimize() (Window)

WinMinimizeAll[Undo]

Not Implemented

WinMove

Implemented

win_move()

WinRestore

Implemented

win_restore()

WinSet

Implemented

win_set_always_on_top() / win_set_bottom() / win_set_disable() / win_set_enable() / win_set_ex_style() / win_set_redraw() / win_set_region() / win_set_style() / win_set_title() / win_set_top() / win_set_trans_color() / win_set_transparent()

WinSetTitle

Implemented

win_set_title()

WinShow

Implemented

win_show()

WinWait

Implemented

win_wait()

WinWait[Not]Active

Implemented

win_wait_not_active()

WinWaitClose

Implemented

win_wait_close()

Sound

AutoHotkey Command

Status

Notes

SoundBeep

Implemented

sound_beep()

SoundGet

Implemented

sound_get()

SoundGetWaveVolume

Implemented

get_volume()

SoundPlay

Implemented

sound_play()

SoundSet

Implemented

sound_set()

SoundSetWaveVolume

Implemented

set_volume()

GUI

GUI methods are largely unimplmented, except ToolTip and TrayTip. We recommend using one of the many Python GUI libraries, such as tkinter from the standard library or a third party package such as pyqt , pysimplegui or similar.

AutoHotkey Command

Status

Notes

Gui

Not Implemented

Gui control types

Not Implemented

GuiControl

Not Implemented

GuiControlGet

Not Implemented

Gui ListView control

Not Implemented

Gui TreeView control

Not planned

IfMsgBox

Not planned

InputBox

Implemented

input_box()

FileSelectFile

Implemented

file_select_box()

FileSelectFolder

Implemented

folder_select_box()

LoadPicture()

Not Implemented

Menu

Not Implemented

MenuGetHandle()

Not Planned

MenuGetName()

Not Planned

MsgBox

Implemented

msg_box()

OnMessage()

Not Planned

Progress

Not Planned

SplashImage

Not Planned

SplashTextOn/Off

Not Planned

ToolTip

Implemented

show_tooltip()

TrayTip

Implemented

show_traytip()

Directives

In general, all directives are technically usable, however many do not have applicable context in the Python library.

Directives are mentioned in tables above and are omitted from this table.

For example, to use the NoTrayIcon directive

from ahk import AHK from ahk.directives import NoTrayIcon ahk = AHK(directives=[NoTrayIcon])

AutoHotkey Command

Notes

#HotkeyInterval

#HotkeyModifierTimeout

#Hotstring

#Include[Again]

Using this directive is strongly discouraged as it is very likely to cause issues. Use with extreme caution.

#InputLevel

#KeyHistory

#MaxHotkeysPerInterval

#MaxMem

#MaxThreads

#MaxThreadsBuffer

#MaxThreadsPerHotkey

Hotkey callbacks are run in Python, so this largely won’t have any significant effect

#MenuMaskKey

#NoEnv

Removed in ahk v1.0.0 – Used by default when using AutoHotkey v1. Not available in AutoHotkey v2.

#NoTrayIcon

If you use hotkeys or hotstrings, you probably also want to configure this as a hotkey transport option

#Persistent

This is on by default in scripts run by this library

#Requires

#SingleInstance

This directive is provided by default (SingleInstance Off for the main thread)

#UseHook

#Warn

Not relevant for this library

#AllowSameLineComments

Not relevant for this library

#ClipboardTimeout

Not relevant for this library

#CommentFlag

Not relevant for this library

#ErrorStdOut

Not relevant for this library

#EscapeChar

Not relevant for this library

#InstallKeybdHook

Not relevant for this library

#InstallMouseHook

Not relevant for this library

#If

Not relevant for this library

#IfTimeout

Not relevant for this library