Modify

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#2318 closed Bug (No Bug)

simple _isPressed middle mouse is not working

Reported by: trettt@… Owned by:
Milestone: Component: AutoIt
Version: 3.3.8.1 Severity: None
Keywords: middle mouse button Cc: trettt@…

Description

hold middle button in notepad, only one 'a' gets pressed

Local $hDLL = DllOpen("user32.dll")

While 1

If _IsPressed("04", $hDLL) Then

Send("{a down}")

While _IsPressed("04", $hDLL)

Sleep(2)

WEnd
Send("{a up}")
sleep(2)

EndIf

WEnd

DllClose($hDLL)

Attachments (0)

Change History (6)

comment:1 by guinness, 13 years ago

Resolution: No Bug
Status: newclosed

comment:2 by anonymous, 13 years ago

author here
i got this code from the documentation
http://www.autoitscript.com/autoit3/docs/libfunctions/_IsPressed.htm

#include <Misc.au3>

Local $hDLL = DllOpen("user32.dll")

While 1

If _IsPressed("10", $hDLL) Then

ConsoleWrite("_IsPressed - Shift Key was pressed." & @CRLF)
; Wait until key is released.
While _IsPressed("10", $hDLL)

Sleep(250)

WEnd
ConsoleWrite("_IsPressed - Shift Key was released." & @CRLF)

ElseIf _IsPressed("1B", $hDLL) Then

MsgBox(0, "_IsPressed", "The Esc Key was pressed, therefore we will close the application.")
ExitLoop

EndIf
Sleep(250)

WEnd

DllClose($hDLL)

comment:3 by anonymous, 13 years ago

_isPressed is fine something is wrong with my send commands :p

comment:4 by anonymous, 13 years ago

sending only up sends a release as well in this code.

Local $hDLL = DllOpen("user32.dll")

While 1

If _IsPressed("04", $hDLL) Then

Send("{a down}")

While _IsPressed("04", $hDLL)

Sleep(2)

WEnd
sleep(2)

EndIf

WEnd

comment:5 by anonymous, 13 years ago

s/sending only up sends a release as well in this code./sending only DOWN sends a release as well in this code.

comment:6 by guinness, 13 years ago

Please use the Forum, not Trac.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.