Sign in to follow this  
Followers 0
giovanigonzales

Send("{ASC - not working ?

10 posts in this topic

hello all,

tried a very basic script, but seems I cant even send a simple ASCII character, when I push the hotkey, nothing hapens

notice I tried the very example from here: http://www.autoitscript.com/autoit3/docs/functions/Send.htm - Send("{ASC 065}")

any sugestion please?

thanks

AutoIt version: 3.2.10.0

OS: Win XP SP2

this is the script:

HotKeySet("!^y", "MyFunc")

While 1

Sleep(100)

WEnd

Func MyFunc()

Send("{ASC 065}")

Send("{ASC 066}")

Send("{ASC 65}")

Send("{ASC 66}")

EndFunc

Share this post


Link to post
Share on other sites



From Helpfile -> Send:

{ASC nnnn} Send the ALT+nnnn key combination

you need 4 digits, i.e. {ASC 0065}

(sorry, can't test right now)

Share this post


Link to post
Share on other sites

Send("{ASC 0065}")

Send("{ASC 0066}")

dosent work either...

Share this post


Link to post
Share on other sites

I just tested the single line

Send("{ASC 0066}")

In my scite and it print out B

Try to just enter this simple line and then run it by pushing F5 (in SciTE)


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

well, Send("{ASC - it works, thanks

the problem is with the Control key. I can assign hotkeys that include Alt, Shift and Windows key, but not with Control key

so

HotKeySet("!y", "MyFunc") - works

HotKeySet("+y", "MyFunc") - works

HotKeySet("#y", "MyFunc") - works

HotKeySet("^y", "MyFunc") - doesnt work !

any idea why?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

HotKeySet("^y", "Terminate") works for me

got latest beta?

I just edited the example:

Does it work for you?

CODE
; Press Esc to terminate script, Pause/Break to "pause"

Global $Paused

HotKeySet("{PAUSE}", "TogglePause")

HotKeySet("^y", "Terminate")

HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d

;;;; Body of program would go here ;;;;

While 1

Sleep(100)

WEnd

;;;;;;;;

Func TogglePause()

$Paused = NOT $Paused

While $Paused

sleep(100)

ToolTip('Script is "Paused"',0,0)

WEnd

ToolTip("")

EndFunc

Func Terminate()

Exit 0

EndFunc

Func ShowMessage()

MsgBox(4096,"","This is a message.")

EndFunc

Edited by Kademlia

Share this post


Link to post
Share on other sites

Hi! About the non-working ^y :

- Make sure you don't have another script still running that also used the same hotkey,

check the tray (happened to me this afternoon while testing another script !)

Share this post


Link to post
Share on other sites

Thanks, it works

however, the weird thing is, when I replace "Exit 0" with "Send("{ASC 0066}")", it doesnt work!

or

HotKeySet("^y", "Terminate")

Func Terminate()

Send("{ASC 0066}")

EndFunc

but....

HotKeySet("!y", "Terminate") - works

I just installed beta - 3.2.11.0, and its the same thing

@whim: I checked that, also tried with another keys (^j, ^k etc) - its the same

I am sorry for this, its either a very weird thing here or.... maybe i'm veeery wrong somewhere

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Send("{ASC 0066}") <- dosn´t work for me either

Try this, works for me:

CODE

Func Terminate()

$y = Chr(0065)

ConsoleWrite($y)

Send($y)

EndFunc

Edited by Kademlia

Share this post


Link to post
Share on other sites

It works, many thanks!

anyways, seems there is a bug using send asc when using Control key, shall I report it?

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