Sign in to follow this  
Followers 0
moose

Hotkey macro help

4 posts in this topic

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

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0