Jump to content
Sign in to follow this  
Armand

Altering some keys - damn water all over my keyboard...

Recommended Posts

Armand

my script:

HotKeySet("^{NUMPAD0}", "NumPad0")  ; Control + Numpad$n
HotKeySet("^{NUMPAD1}", "NumPad1")  
HotKeySet("^{NUMPAD2}", "NumPad2")  
HotKeySet("^{NUMPAD3}", "NumPad3")  
HotKeySet("^{NUMPAD4}", "NumPad4")  
HotKeySet("^{NUMPAD5}", "NumPad5")  
HotKeySet("^{NUMPAD6}", "NumPad6")  
HotKeySet("^{NUMPAD7}", "NumPad7")  
HotKeySet("^{NUMPAD8}", "NumPad8") 
HotKeySet("^{NUMPAD9}", "NumPad9")  

;These should generate the 'AS-IF' ALT+NUMBER, from the top of the keyboard.

Func NumPad0()
    Send("{ASC 41}")
EndFunc
Func NumPad1()
    Send("{ASC 33}")
EndFunc
Func NumPad2()
    Send("{ASC 64}")
EndFunc
Func NumPad3()
    Send("{ASC 35}")
EndFunc
Func NumPad4()
    Send("{ASC 36}")
EndFunc
Func NumPad5()
    Send("{ASC 37}")
EndFunc
Func NumPad6()
    Send("{^}")
EndFunc
Func NumPad7()
    Send("{ASC 38}")
EndFunc
Func NumPad8()
    Send("{ASC 42}")
EndFunc
Func NumPad9()
    Send("{ASC 40}")
EndFunc

While 1
    Sleep(360000) ;No need to waste CPU here, HotKeySet are event called (right?)
WEnd

all of my number-buttons got ruined somehow, and i need them to continue writing my code... i don't have the time nor the will power to get to the marken ATM, thus i'm trying to make a use of the numpad numbers instead...

(i rather a hotkeyset than using ascii all day long....)

- why doesn't it work ?

THANKS IN ADVANCE!!!

Edited by Armand

[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Share this post


Link to post
Share on other sites
picaxe

Hi Armand

Trys this. Note any existing ctrl-keypad hooks will probably overide.

Regards

Gordon

HotKeySet("^{NUMPAD0}", "NumPad0")  ; Control + Numpad$n
HotKeySet("^{NUMPAD1}", "NumPad1")  
HotKeySet("^{NUMPAD2}", "NumPad2")  
HotKeySet("^{NUMPAD3}", "NumPad3")  
HotKeySet("^{NUMPAD4}", "NumPad4")  
HotKeySet("^{NUMPAD5}", "NumPad5")  
HotKeySet("^{NUMPAD6}", "NumPad6")  
HotKeySet("^{NUMPAD7}", "NumPad7")  
HotKeySet("^{NUMPAD8}", "NumPad8") 
HotKeySet("^{NUMPAD9}", "NumPad9")  

;These should generate the 'AS-IF' ALT+NUMBER, from the top of the keyboard.

Func NumPad0()
    MsgBox(0, "", "numpad0")
    Send("{)}")
EndFunc
Func NumPad1()
    Send("{!}")
EndFunc
Func NumPad2()
    Send("{@}")
EndFunc
Func NumPad3()
    Send("{#}")
EndFunc
Func NumPad4()
    Send("{$}")
EndFunc
Func NumPad5()
    Send("{%}")
EndFunc
Func NumPad6()
    Send("{^}")
EndFunc
Func NumPad7()
    Send("{&}")
EndFunc
Func NumPad8()
    Send("{*}")
EndFunc
Func NumPad9()
    Send("{(}")
EndFunc

While 1
    Sleep(360000) ;No need to waste CPU here, HotKeySet are event called (right?)
WEnd
Edited by picaxe

Share this post


Link to post
Share on other sites
picaxe

Sorry, forgot to remove troubleshooting msgbox

HotKeySet("^{NUMPAD0}", "NumPad0")  ; Control + Numpad$n
HotKeySet("^{NUMPAD1}", "NumPad1")  
HotKeySet("^{NUMPAD2}", "NumPad2")  
HotKeySet("^{NUMPAD3}", "NumPad3")  
HotKeySet("^{NUMPAD4}", "NumPad4")  
HotKeySet("^{NUMPAD5}", "NumPad5")  
HotKeySet("^{NUMPAD6}", "NumPad6")  
HotKeySet("^{NUMPAD7}", "NumPad7")  
HotKeySet("^{NUMPAD8}", "NumPad8") 
HotKeySet("^{NUMPAD9}", "NumPad9")  

;These should generate the 'AS-IF' ALT+NUMBER, from the top of the keyboard.

Func NumPad0()
    Send("{)}")
EndFunc
Func NumPad1()
    Send("{!}")
EndFunc
Func NumPad2()
    Send("{@}")
EndFunc
Func NumPad3()
    Send("{#}")
EndFunc
Func NumPad4()
    Send("{$}")
EndFunc
Func NumPad5()
    Send("{%}")
EndFunc
Func NumPad6()
    Send("{^}")
EndFunc
Func NumPad7()
    Send("{&}")
EndFunc
Func NumPad8()
    Send("{*}")
EndFunc
Func NumPad9()
    Send("{(}")
EndFunc

While 1
    Sleep(360000) ;No need to waste CPU here, HotKeySet are event called (right?)
WEnd

Share this post


Link to post
Share on other sites
aslani

Simply add "0" in front of the numbers.

Example:

Func NumPad0()
    Send("{ASC 041}")
EndFunc
Func NumPad1()
    Send("{ASC 033}")
EndFunc

From Send() help file;

(When using 2 digit ASCII codes you must use a leading 0, otherwise an obsolete 437 code page is used).

That might be the source of your problem. :)

[font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version

Share this post


Link to post
Share on other sites
HeffeD

all of my number-buttons got ruined somehow, and i need them to continue writing my code...

I don't think it's water that's the problem. There's no way you could spill water so selectively to wipe out only your number keys... Not to mention that unless you have really hard water, after the water dries, your keyboards contacts should work just fine. I think you've got something else going on there...

Share this post


Link to post
Share on other sites
aslani

I don't think it's water that's the problem. There's no way you could spill water so selectively to wipe out only your number keys... Not to mention that unless you have really hard water, after the water dries, your keyboards contacts should work just fine. I think you've got something else going on there...

Quote of the day!

:)


[font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version

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  

×