SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Sep 2001
    Location
    oakland, ca, usa
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    press and hold left mouse button

    does anyone know how to mimic the pressing and holding (for two seconds) the left mouse button?

    PressMouse doesn't work.

    Tried this...
    const integer MK_LBUTTON = 0x001
    SendMessage(this.GetHandle(), WM_MOUSEMOVE, MK_LBUTTON, Pos.x | (Pos.y << 8))

    doesn't do anything noticeable.

    thanks

    ------------------

  2. #2
    Senior Member
    Join Date
    Nov 2000
    Location
    Bloomington, IL
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: press and hold left mouse button

    Try this code:

    [ ] WINDOW w
    [ ] w = Browser.GetActive()
    [ ]
    [ ] w.PressKeys ("<Button1>" , 2)

    See PressKeys in help.

    Mikef

    ------------------

  3. #3
    Member
    Join Date
    Oct 2000
    Location
    India
    Posts
    59
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: press and hold left mouse button

    Hi,
    Try increasing the mouse delay option.

    Agent.SetOption (OPT_MOUSE_DELAY, 0)

    Mouse Event Delay (Seconds)
    Specifies the delay used before each mouse event in a script. The delay affects moving the mouse, pressing buttons, and releasing buttons.
    Default is 0 seconds.

    Hope this helps

    RG

    ------------------

  4. #4
    Member
    Join Date
    Jun 2000
    Location
    Derby, UK
    Posts
    37
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: press and hold left mouse button

    What exactly do you need to press the mouse down for two seconds?
    Maybe what your trying to do could be achieved better in another way.
    Explain the problem please.

    ------------------

  5. #5
    Junior Member
    Join Date
    Sep 2001
    Location
    oakland, ca, usa
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: press and hold left mouse button

    The reason for holding down the mouse key
    is irrelevant. The problem still remains.

    However...

    I have an application that isn't a browser, doesn't use standard toolbar controls and requires the user to hold the LMouse button down for a short period of time to activate a toolbar icon's sub-menu.

    For some reason PressKeys places the mouse at 0,0 of the parent window after I've used MoveMouse to position it over the toolbar icon.

    As usual a simple GUI activity has become my nightmare.

    cheers!

    ------------------

  6. #6
    Junior Member
    Join Date
    Sep 2001
    Location
    oakland, ca, usa
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: press and hold left mouse button

    Solved...

    Agent.SetOption(OPT_MOUSE_DELAY, 0.005)

    TargetWindow.DragMouse (1, aCoords.xPos,
    aCoords.yPos,
    aCoords.xSize,
    aCoords.ySize)

    // Resume normal speed
    //
    Agent.SetOption (OPT_MOUSE_DELAY,0)

    Agent.FlushEvents ()

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 03:57 PM.

Copyright BetaSoft Inc.