--===============91478496496033723== Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-02=_jm9T/T1k6TtjCcb"; charset="iso-8859-1" Content-Transfer-Encoding: 7bit --Boundary-02=_jm9T/T1k6TtjCcb Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Description: signed data Content-Disposition: inline On Saturday 30 August 2003 00:16, Jason Harris wrote: > 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() =3D=3D 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. state() is which buttons where pressed when the event happened, button()=20 is which button triggered the event. The other checks will work in move events, where the event is not=20 triggered by a button hope that made sense. Cheers, Kevin =2D-=20 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Kevin Krammer Developer at the Kmud Project http://www.kmud.de/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --Boundary-02=_jm9T/T1k6TtjCcb Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQA/T9mjnKMhG6pzZJIRAmGyAJ9TdQlRN02YXbEQWCCa6TqEwp34QACbB5eL XbOiWjBmTWzypkkDYwivjOA= =bs5/ -----END PGP SIGNATURE----- --Boundary-02=_jm9T/T1k6TtjCcb-- --===============91478496496033723== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============91478496496033723==--