Jump to content

sending text with numberpads


 Share

Recommended Posts

hi..

i tried sending text with a press of a key <_<

#Include <Misc.au3>

if _IsPressed('61')

then

Send("{a 1}") ;Sends 1 'h' characters

Send("{a 1}") ;Sends 5 'e' characters

Send("{a 1}") ;Sends 5 'j' characters

endfunc

can anyone help me :S?

Link to comment
Share on other sites

#Include <Misc.au3>

if _IsPressed('61')

then

Send("{a 1}") ;Sends 1 'h' 1 a characters

Send("{a 1}") ;Sends 5 'e' 1 a characters

Send("{a 1}") ;Sends 5 'j' 1 a characters

endfunc

This script will run and exit immediately. Include a loop so it checks continuously.

But maybe using HotKeySet() is better..?

;Set hotkeys:
HotKeySet("{numpad1}", "a")
HotKeySet("{numpad2}", "e")
HotKeySet("{numpad3}", "i")
HotKeySet("{numpad4}", "o")
HotKeySet("{numpad5}", "u")
HotKeySet("{ESC}", "_Quit")

;Idle around
While 1
    Sleep(50)
WEnd

;Functions
Func a()
    Send("a")
EndFunc   ;==>a

Func e()
    Send("e")
EndFunc   ;==>e

Func i()
    Send("i")
EndFunc   ;==>i

Func o()
    Send("o") 
EndFunc   ;==>o

Func u()
    Send("u")
EndFunc   ;==>u

Func _Quit()
    Exit
EndFunc   ;==>_Quit
Link to comment
Share on other sites

This script will run and exit immediately. Include a loop so it checks continuously.

But maybe using HotKeySet() is better..?

;Set hotkeys:
HotKeySet("{numpad1}", "a")
HotKeySet("{numpad2}", "e")
HotKeySet("{numpad3}", "i")
HotKeySet("{numpad4}", "o")
HotKeySet("{numpad5}", "u")
HotKeySet("{ESC}", "_Quit")

;Idle around
While 1
    Sleep(50)
WEnd

;Functions
Func a()
    Send("a")
EndFunc   ;==>a

Func e()
    Send("e")
EndFunc   ;==>e

Func i()
    Send("i")
EndFunc   ;==>i

Func o()
    Send("o") 
EndFunc   ;==>o

Func u()
    Send("u")
EndFunc   ;==>u

Func _Quit()
    Exit
EndFunc   ;==>_Quit
thx for your time <_<

i tried modify the code and i want it to write text not just letters, it wont work :/

Link to comment
Share on other sites

?

Just change Send("a") with Send("your text")

It HAS to work.

No ;/ Works fine if i dont use enter, I want spaces between the words <_<

ERROR :

Func hej neger()

Error badly formatted "func" statement

Code :

;Set hotkeys:

HotKeySet("{numpad1}", "hej neger")

HotKeySet("{numpad2}", "e")

HotKeySet("{numpad3}", "i")

HotKeySet("{numpad4}", "o")

HotKeySet("{numpad5}", "u")

HotKeySet("{ESC}", "_Quit")

;Idle around

While 1

Sleep(50)

WEnd

;Functions

Func hej neger()

Send("hej neger")

EndFunc ;==>hej neger

Func e()

Send("e")

EndFunc ;==>e

Func i()

Send("i")

EndFunc ;==>i

Func o()

Send("o")

EndFunc ;==>o

Func u()

Send("u")

EndFunc ;==>u

Func _Quit()

Exit

EndFunc ;==>_Quit

Edited by newb2007
Link to comment
Share on other sites

<_<

You can't use spaces in a function name, dude...

look at my name dude :)

hmm, is there any other way?

If you load a txt file automatic, take the first line copy that and have a hotkey for paste?

Edited by newb2007
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...