Re: Did I press the Left or Right button?
From: alpine (alpine_don'tsendspam_at_mvps.org)
Date: 05/11/04
- Next message: Mike D Sutton _at_ Work: "Re: Picturebox &r StrecthBlt"
- Previous message: alex: "RE: WaitForMultipleObjects"
- In reply to: Dave F.: "Did I press the Left or Right button?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 11 May 2004 09:31:18 -0600
Have a look at the Return Value section of the GetAsyncKeyState topic
in the MSDN. Different bits are set in the return value depending on
whether the button is currently down or was pressed since the last
call to GetAsyncKeyState. Since you aren't filtering the bits in your
conditions, you may be getting errant results due to the previous
mouse down bit being set.
HTH,
Bryan
____________________________________________________________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alpine_don'tsendspam@mvps.org Hunter S. Thompson -
Microsoft MVP-Visual Basic Fear and Loathing in LasVegas
On Tue, 11 May 2004 14:24:03 +0100, "Dave F." <df@bh.com> wrote:
>Hi
>
>I'm using Autocad VBA (6.0)
>
>I want to test for three events when selecting an entity:
>
>1. Left button - entity selected
>2.Left Button - entity missed
>3.right button.
>
>1. works fine, but 2 & 3 are very tempermental..
>Sometimes it will always go down the 'left' route.
>Othertimes (after I've clicked on an object), it works for a while, but if I
>reload it, it fails to work again!
>
>Any Ideas?
>Thanks in Advance
>
>Dave F.
>
>Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long)
>As Integer
>
>Public Const VK_ESCAPE = &H1B
>Public Const VK_LBUTTON = &H1
>Public Const VK_RBUTTON = &H2
>
>Sub testEntSel()
> Dim RtnEnt As AcadEntity
> Dim pt As Variant
>
> On Error GoTo Err_Control
> ThisDrawing.Utility.GetEntity RtnEnt, pt, "Select an Entity to Offset: "
> Debug.Print RtnEnt.ObjectName
> Exit Sub
>Err_Control:
> If GetAsyncKeyState(VK_LBUTTON) Then
> Debug.Print "L"
> ElseIf GetAsyncKeyState(VK_RBUTTON) Then
> Debug.Print "R"
> End If
>End Sub
>
- Next message: Mike D Sutton _at_ Work: "Re: Picturebox &r StrecthBlt"
- Previous message: alex: "RE: WaitForMultipleObjects"
- In reply to: Dave F.: "Did I press the Left or Right button?"
- Messages sorted by: [ date ] [ thread ]