Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 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 Changed 9 years ago by guinness

  • Resolution set to No Bug
  • Status changed from new to closed

comment:2 Changed 9 years ago by anonymous

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 Changed 9 years ago by anonymous

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

comment:4 Changed 9 years ago by anonymous

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 Changed 9 years ago by anonymous

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 Changed 9 years ago by guinness

Please use the Forum, not Trac.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.