Re: Ctrl-Click keyboard mouse event

2009-11-11 Thread Carlos Pereira

Hi Emmanuel,
thank you very much, that's exactly what I needed,

Best regards,
Carlos


When a button press event is triggered, what is the proper way to know if
the user is pressing down the Ctrl key?



I think that this is what you need:

if (event->button == 1 && (event->state & GDK_CONTROL_MASK) != 0)
{
  /* Button 1 with contro clicked */
}

  

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Ctrl-Click keyboard mouse event

2009-11-10 Thread Emmanuel Rodriguez
On Tue, Nov 10, 2009 at 10:56 PM, Carlos Pereira <
jose.carlos.pere...@ist.utl.pt> wrote:

> Hi list,
> When a button press event is triggered, what is the proper way to know if
> the user is pressing down the Ctrl key?
>
> Tipically I would want to know this inside a button press event callback:
>
> int handle_button_press (GtkWidget *widget,
> GdkEventButton *event, void *data)
> {
> mouse button has been clicked: is Ctrl key down???
> ...
> }
>

I think that this is what you need:

if (event->button == 1 && (event->state & GDK_CONTROL_MASK) != 0)
{
  /* Button 1 with contro clicked */
}


-- 
Emmanuel Rodriguez
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Ctrl-Click keyboard mouse event

2009-11-10 Thread Carlos Pereira

Hi list,
When a button press event is triggered, what is the proper way to know 
if the user is pressing down the Ctrl key?


Tipically I would want to know this inside a button press event callback:

int handle_button_press (GtkWidget *widget,
GdkEventButton *event, void *data)
{
mouse button has been clicked: is Ctrl key down???
...
}

(I need this to implement multiple selections from my OpenGL code that 
are consistent with multiple selections in GtkTreeView)


Thanks,
Carlos
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list