Jump to content

Need help to write code


Recommended Posts

Hi, Everybody....

I love Autoit, but I am lack of knowledge of its language. Please anybody help me to write code; I am going to describe here what I want.........

It can be called Key Mapping (Not Replacing). It means if I press a key, another key also performs. For example; when I press Key "1", Key "q" also performs at the same time.

The keys below are the keys mapping that I want:

"1" mapping with "q"

"2" mapping with "w"

"3" mapping with "e"

"4" mapping with "r"

Please save it as *.au3 that I am be able to add more keys or edit them.......

Thanks

Link to comment
Share on other sites

Hi, Everybody....

I love Autoit, but I am lack of knowledge of its language. Please anybody help me to write code; I am going to describe here what I want.........

It can be called Key Mapping (Not Replacing). It means if I press a key, another key also performs. For example; when I press Key "1", Key "q" also performs at the same time.

The keys below are the keys mapping that I want:

"1" mapping with "q"

"2" mapping with "w"

"3" mapping with "e"

"4" mapping with "r"

Please save it as *.au3 that I am be able to add more keys or edit them.......

Thanks

Searching the forum, I found this,

http://www.autoitscript.com/forum/index.ph...st&p=502559

So to get you started

#NoTrayIcon
#include "misc.au3"

_Singleton(@ScriptName)

; set hotkeys
HotKeySet("{ESC}", "Terminate")


HotKeySet(Chr(Asc('1')), "No1")

While GUIGetMsg() <> -3
    Sleep(1000)   
WEnd

; send broken alphabets
Func No1()
    HotKeySet("1")
    Send("1")   
    Send("q")
    HotKeySet(Chr(Asc('1')), "No1")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Press 1 and 1q appears that's all I've done. And press Esc to exit.

Good luck.

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...