sound_beep ( frequency = 440, duration = 1000 ) # Play a beep for 1 second (duration in microseconds) ahk. sound_play ( 'C: \\ path \\ to \\ sound.wav' ) # Play an audio file ahk. set_clipboard_all ( saved_clipboard ) # restore saved content from earlier Sound from ahk import AHK ahk = AHK () ahk. from ahk import AHK ahk = AHK () # save all clipboard contents in all formats saved_clipboard = ahk. You may also get/set ClipboardAll - however, you should never try to call set_clipboard_all with any otherĭata than as exactly as returned by get_clipboard_all or unexpected problems may occur. get_clipboard () # get clipboard text contents # 'hello □' send_input ( 'Hello, ' ) # set clipboard text contents ahk. type ( 'hello, world!' ) # Send keys, as if typed (performs string escapes for you) ahk. mouse_drag ( 100, 100, relative = True ) # Holds down primary button and moves the mouse Keyboard from ahk import AHK ahk = AHK () ahk. right_click () # Clicks the secondary mouse button ahk. click ( button = 'R', click_count = 2 ) # Clicks the right mouse button twice ahk. click ( 100, 200, coord_mode = 'Screen' ) # click relative to the screen instead of active window ahk. click ( 200, 200 ) # Moves the mouse to a particular position and clicks (relative to active window) ahk. click () # Click the primary mouse button ahk. mouse_position = ( 100, 100 ) # Moves the mouse instantly to absolute screen position ahk. mouse_move ( 100, 100, speed = 10, relative = True ) # Moves the mouse reletave to the current position ahk. get_mouse_position ( coord_mode = 'Screen' ) # get coordinates relative to the screen ahk. mouse_position # Returns a tuple of mouse coordinates (x, y) (relative to active window) ahk. clear_hotstrings () # remove all registered hotstrings Mouse from ahk import AHK ahk = AHK () ahk. remove_hotstring ( 'btw' ) # remove a hotstring by its trigger sequence ahk. add_hotstring ( 'btw', my_callback ) # call python function in response to the hotstring add_hotstring ( 'btw', 'by the way' ) # string replacements ahk. from ahk import AHK ahk = AHK () def my_callback (): print ( 'hello callback!' ) ahk. In addition to Hotstrings supporting normal AHK string replacements, you can also provide Python callbacks (with optional exception handlers) in response to hotstrings triggering. Hotstrings can also be added to the hotkey process thread. See also the relevant AHK documentation Hotstrings
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |