如何在GTK +应用程序的“drawingarea_button_press_event_cb”功能中按下CTRL?
void drawingarea_button_press_event_cb( GtkWidget *widget, GdkEventButton *event )
{
........
}
答案 0 :(得分:3)
检查state
结构的GdkEventButton
字段。如果按住Control,它将设置GDK_CONTROL_MASK
位:
if(event->state & GDK_CONTROL_MASK)
printf("You're totally in control!\n");