giovanigonzales Posted January 31, 2008 Posted January 31, 2008 hello all,tried a very basic script, but seems I cant even send a simple ASCII character, when I push the hotkey, nothing hapensnotice I tried the very example from here: http://www.autoitscript.com/autoit3/docs/functions/Send.htm - Send("{ASC 065}") any sugestion please?thanksAutoIt version: 3.2.10.0OS: Win XP SP2this is the script:HotKeySet("!^y", "MyFunc")While 1 Sleep(100)WEndFunc MyFunc()Send("{ASC 065}")Send("{ASC 066}")Send("{ASC 65}")Send("{ASC 66}")EndFunc
whim Posted January 31, 2008 Posted January 31, 2008 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)
giovanigonzales Posted January 31, 2008 Author Posted January 31, 2008 Send("{ASC 0065}") Send("{ASC 0066}") dosent work either...
Shevilie Posted January 31, 2008 Posted January 31, 2008 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
giovanigonzales Posted February 2, 2008 Author Posted February 2, 2008 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?
Kademlia Posted February 2, 2008 Posted February 2, 2008 (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 February 2, 2008 by Kademlia
whim Posted February 2, 2008 Posted February 2, 2008 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 !)
giovanigonzales Posted February 2, 2008 Author Posted February 2, 2008 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
Kademlia Posted February 2, 2008 Posted February 2, 2008 (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 February 2, 2008 by Kademlia
giovanigonzales Posted February 2, 2008 Author Posted February 2, 2008 It works, many thanks! anyways, seems there is a bug using send asc when using Control key, shall I report it?
Hawk Posted February 17, 2022 Posted February 17, 2022 Can confirm the bug that Send("{ASC XXXX}") does not work with hotkeys (I'm using "^!v" (Ctrl + Alt + v)) for the first character in the function. I can do Send("a" & "{ASC XXXX}") and the ASC will print! But not if the ASC is at the beginning of Send function. I use the workaround of Kademlia now, avoid ASC and use Chr function to input ASCII characters.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now