Jump to content

Release All Keys


Recommended Posts

This is what I wanted to do..

Func ReleaseAllKeys()
    For $i = 32 To 126
        Send("{" & Chr($i) & " Up}")
    Next
EndFunc

But even after a very brief examination, it's obvious that won't work.

I can't really think of a way to do this easily =/

Link to comment
Share on other sites

Based on the Send documentation this might work:

Func releaseAllKeys()

    Local $ascKey
    For $ascKey = 32 to 126
        
        Local $key = Chr ($ascKey)
        Send ("{" & $key & " up}")
    Next

EndFunc

Edit: Formating inside a '

' tag is ... finicky
Edited by Fulano

#fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!

Link to comment
Share on other sites

If that does work it's crazy as the behaviour of both is identical.

by the way it's not required to declare $ascKey before the loop as it's declared in the loop anyway so:

Func releaseAllKeys()
    For $ascKey = 32 to 126        
        Local $key = Chr ($ascKey)
        Send ("{" & $key & " up}")
    Next
EndFunc

Again though, this executes the exact same Send() command as the OP's code, so I highly doubt this will work given his code does not.

Edited by dani
Link to comment
Share on other sites

If that does work it's crazy as the behaviour of both is identical.

by the way it's not required to declare $ascKey before the loop as it's declared in the loop anyway so:

Func releaseAllKeys()
    For $ascKey = 32 to 126        
        Local $key = Chr ($ascKey)
        Send ("{" & $key & " up}")
    Next
EndFunc

Again though, this executes the exact same Send() command as the OP's code, so I highly doubt this will work given his code does not.

I grew up on C .... and it's affected me :mellow:

I haven't tested this yet, but the code comes from the bottom of the Send documentation, so it should work ... in a perfect world.

#fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!

Link to comment
Share on other sites

Fair enough, then I guess it should work, which leads me to ...

@MaXiMiUS, do some more testing :mellow:

Or maybe it won't work.

Maybe

ControlSend("", "", "", " ", 0)

will though?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...