Jump to content

Recommended Posts

Posted

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

Posted

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)

Posted

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

Posted

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?

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
Posted

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 !)

Posted

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

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
  • 14 years later...
Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...