RE: [gtk-list] HELP! How do I detect a shift-click
- From: Trog <trog gtk org>
- To: gtk-list redhat com
- Subject: RE: [gtk-list] HELP! How do I detect a shift-click
- Date: Sat, 20 Jun 1998 14:29:18 +0100 (BST)
On 19-Jun-98 bert hubert wrote:
> Hi everybody,
>
> I'm working with the wonderful GTK, but can't seem to detect a
> shift-click on an eventbox. Somehow, whatever I do, event->type
> doesn'tWhen you get a key press event, you can check
> change when I press any of the shift keys. Any clues?
>
I refer you to Owen's previous answer to this question
-------------------------------------------
When you get a key press event, you can check
event->state
For instance,
if (event->state & GDK_SHIFT_MASK)
/* shift key was pressed */
The relevant modifiers in this bitfield are:
/* Types of modifiers.
*/
typedef enum
{
GDK_SHIFT_MASK = 1 << 0,
GDK_LOCK_MASK = 1 << 1,
GDK_CONTROL_MASK = 1 << 2,
GDK_MOD1_MASK = 1 << 3,
GDK_MOD2_MASK = 1 << 4,
GDK_MOD3_MASK = 1 << 5,
GDK_MOD4_MASK = 1 << 6,
GDK_MOD5_MASK = 1 << 7,
GDK_BUTTON1_MASK = 1 << 8,
GDK_BUTTON2_MASK = 1 << 9,
GDK_BUTTON3_MASK = 1 << 10,
GDK_BUTTON4_MASK = 1 << 11,
GDK_BUTTON5_MASK = 1 << 12
} GdkModifierType;
Regards,
Owen
--------------------------------------
Tony
---
E-Mail: trog@gtk.org
Time to take stock. Go home with some office supplies.
Go Bezerk! http://www.gtk.org/~trog
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]