Re: [gtk-list] RE: HELP! How do I detect a shift-click



On Sat, 20 Jun 1998, Trog wrote:

> > 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

This is what I try, but it doesn't work. Code:

void pickup(GtkWidget *w, GdkEventButton *e, gpointer p)
{

    if(e->state&GDK_SHIFT_MASK)
    {
        printf("Shift-click!\n");
        return;
    }
    else 
      printf("Type: %d, State: %d\n",e->type,e->state);

}

Which is connected by:

gtk_signal_connect(GTK_OBJECT(eventbox),"event",
            GTK_SIGNAL_FUNC(pickup),(gpointer) l);


Or do you mean that I need to check *keyboard* events, and monitor the
shift state myself?

Thanks for your time, btw.


            Delft University of Technology, department of Physics
  Phone: +31-15-2133685 / Donkerstraat 9a, 2611 TE, Delft, The Netherlands

                      Inspice et cautus eris - D11T'95



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]