Re: Questions about Overlay and multiple key-strokes
- From: "Brian J. Tarricone" <bjt23 cornell edu>
- To: gtk-app-devel-list gnome org
- Subject: Re: Questions about Overlay and multiple key-strokes
- Date: Fri, 27 May 2005 13:13:17 -0700
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Michal Porzuczek wrote:
Question 2. How is it possible to perform key commands such as
Ctrl+D for example. Using the key_press_event callback I tried
using nested ifs like this to no avail:
if (event->keyval == 65507) if (event->keyval == 65361)
I'm not really sure what you're trying to do there: how can
event->keyval be equal to two different things at once?
Use the constants in gdk/gdkkeysyms.h for the actual key (in your
case, the 'd' key), and use the modifier constants, checking
event->state. Check out the GdkModifierType enum in gdk/gdktypes.h.
So you'd do something like:
if(event->keyval == GDK_D && event->state & GDK_CONTROL_MASK)
-brian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
iD8DBQFCl39d6XyW6VEeAnsRArXxAJ4irKJAxmA4WWwLd/KecP9XLJJ8NgCfcTRW
838/q91dsx8ComWG2ZyVUZk=
=LbVc
-----END PGP SIGNATURE-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]