Detect a sequence of hotkeys

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
stepanVL
Posts: 11
Joined: 27 Jun 2017, 08:56

Detect a sequence of hotkeys

23 Aug 2017, 15:15

I want to run code if a sequence `^c^f^v` was pressed. Hotstrings don't seem to work with modifiers. This works:

Code: Select all

::btw::MsgBox You typed "btw".
This doesn't:

Code: Select all

::^c^v::MsgBox You typed "copy-paste".
Keywait is possible, but it seems to pause the script for the time of waiting. I can intercept all keys and update lastPressedKeysList, but this requires a lot of broilerplate code. Is there a native way to check history of last keys pressed?

Why I need this: an editor has a built in behavior : on ^c::copy text to buffer. On ^f::open search box AND paste buffer. Should have saved a hotkey, but because of ^c^f^v habit I end up pressing three more keys : ^a, Backspace, ^v. When I press ^c^f^v editor pasts text twice. I would like to block ^v if previous keys were exactly ^c^f so that the editor behaves like other programs.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Exies, hiahkforum, JoeWinograd, mikeyww and 128 guests