Jump to content

Hotkey macro help


 Share

Recommended Posts

Hi, I'm trying to create a keyboard macro that will send text to an editor when a key combination is pressed (alt+a). Whenever I press alt+a, I get an error beep, and the first letter of the macro text is missing.

Thanks in advance.

Opt("SendKeyDelay", 0)
Opt("SendKeyDownDelay", 0)

; Set the HotKeys
HotKeySet("!a", "_align")
HotKeySet("{ESC}", "On_Exit")

; Now keep the script active
While 1
    Sleep(10)
WEnd

Func _align()
    ; Unset the HotKey
    HotKeySet("!a")
    ; Send the keys
    Send("hello")
    ; Reset the HotKey
    HotKeySet("!a", "_align")
EndFunc

Result when alt+a is pressed:

ello

Link to comment
Share on other sites

I don't use Scite. Broken in Notepad++ and Notepad here (Windows XP)

Interestingly, if I hold alt down, and continue to press 'a' 'a' 'a', the first one is broken, but subsequent ones work ok. =\

Edited by moose
Link to comment
Share on other sites

  • Developers

Try adding a sleep(200) before the Send() to allow for the release of Alt ... else you simulate ALT+(the send characters)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...