[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    question about QMouseEvents
From:       Jason Harris <kstars () 30doradus ! org>
Date:       2003-08-29 22:16:48
[Download RAW message or body]

Hello,

I need to check if the user has pressed the left mouse button while holding 
down the CTRL key.

This doesn't work:
  if ( e->state() & ( ControlButton & LeftButton ) )

Nor this:
  if ( (e->state() & ControlButton) && (e->state() & LeftButton ) )

But this does:
  if ( (e->state() & ControlButton) && (e->button() == LeftButton ) )

Can someone tell me why the first two forms do not work (i.e., the condition 
is not true if LMB pressed while CTRL pressed)?

Just curious, so don't spend time looking it up on my behalf...just asking in 
case anyone happens to know offhand.

thanks!
Jason
-- 
KStars:  A K Desktop Planetarium
http://edu.kde.org/kstars
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic