Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting Right Mouse Double Click

Status
Not open for further replies.

johncp

Technical User
Aug 28, 2005
47
GB
I want my Form to separately recognise left and right double mouse clicks, and the left double click handler to recognise a depressed key so single button mouse users can emulate a right double click.

The Builder mouse dblclk handler uses method TNotifyEvent which provides no event parameters.

How do I use Builder's OnDblClick event handler to find which mouse button and any keys that were pressed ?

or

Windows generates a wm_LBUTTONDBLCLK msg. & a wm_RBUTTONDBLCLK msg.
if the window has the CS_DBLCLKS style (What is this ?)
Do I override the Builder component method for handling the event, with my own method to handle the windows message ?

johnp
 
See if Thread101-723261 is any help.

James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
James. Thread didn't help me but
I got answer from the Borland forum
borland.public.cppbuilder.components.using
see post 5/5/06 12.43
solution is

johnp wrote:
> I want to detect left and right double mouse clicks.
> No method exists in BCB6 Standard Ed. for right
> dbl clicks ....

Yes there are. They were already in bcb5 and maybe before.

void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
if ( Shift.Contains ( ssDouble ) )
{
if ( Button == mbLeft ) //do something ;
else if ( Button == mbRight )//do something ;
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top