Re: Ctrl-Click keyboard mouse event
- From: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
- To: Carlos Pereira <jose carlos pereira ist utl pt>
- Cc: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: Re: Ctrl-Click keyboard mouse event
- Date: Wed, 11 Nov 2009 08:35:32 +0100
On Tue, Nov 10, 2009 at 10:56 PM, Carlos Pereira <
jose carlos pereira 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]