Jump to content

{LALT down} and {LALT up}


Recommended Posts

Hi

My sister is a one-handed.

She has a program that requires holding the LALT and mouse click.

I wrote a program that when you press the middle mouse button sends {LALT down}

And after releasing the middle button sends {LALT up}

Simple but... not work :D

{LALT down} work - key is pressed

{LALT up} not work - key is pressed all the time

Any idea why?

#include <misc.au3>

sleep(100)

HOTKEYSET("{F9}", "_exit")

Global $down = False

while 1
    If _IsPressed(4) And Not $down Then
        send('{LALT down}',0)
        $down = True
        Beep(500,100)
    EndIf
    If Not _IsPressed(4) And $down Then
        send('{LALT up}',0)
        $down = False
        Beep(100,100)
    EndIf
    sleep(10)
Wend

Func _exit()
    Beep(1500,500)
    Exit    
EndFunc

I did try:

send('{LALT down}',0)
sleep(500)
send('{LALT up}',0)

and again {LALT up} not work - key is pressed all the time

Please help to find a solution. The matter is urgent for me.

Tahnk you

I have:

AutoIt (and AutoItX) v3.3.0.0 released (24th December, 2008)

and

SciTE Version 1.78 May 21 2009 20:37:14 by Neil Hodgson. Updated: Valik & Jos.

Link to comment
Share on other sites

Please help to find a solution.

LALT (and RALT) is (are) in the docs, and both are handled by up and down. Your code didn't work for me either, but when I changed LALT to ALT, it (the code) performed as expected. Before I made the change, I noticed that with LALT down enabled, the hotkey wouldn't be caught, and the key ESC minimized the editor. I also added consolewrite lines after each of the sends, and they displayed as expected.

{LALT down} and {LALT up}

EDIT: Well I guess I posted incorrect info, I've got too much going on here.. changing LALT to ALT only works with the second bit of code that the OP posted..

Edited by snowmaker

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

LALT (and RALT) is (are) in the docs, and both are handled by up and down. Your code didn't work for me either, but when I changed LALT to ALT, it (the code) performed as expected. Before I made the change, I noticed that with LALT down enabled, the hotkey wouldn't be caught, and the key ESC minimized the editor. I also added consolewrite lines after each of the sends, and they displayed as expected.

{LALT down} and {LALT up}

EDIT: Well I guess I posted incorrect info, I've got too much going on here.. changing LALT to ALT only works with the second bit of code that the OP posted..

It doesn't work for me either if I use LALT, but if I use ALTDOWN and ALTUP it does work. Must it be Left Alt zbychos?
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

  • 3 weeks later...

Well...

I see that the problem with the command LALT (up) is not the solution.

In this case treat it as a big bug in the language.

Nothing is perfect ... unfortunately.

Well with the C++ and VB is free from this error :D

regards

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...