Commit c9635ddd authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

fixed check for modifier keys and always return on a matched event(bug

2007-09-26  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpcontrollerwheel.c (gimp_controller_wheel_scroll):
	fixed check for modifier keys and always return on a matched
	event(bug #480319). Also reordered the list of events as the code
	does not any longer rely on a certain order.

svn path=/trunk/; revision=23657
parent c8ef39e0
2007-09-26 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcontrollerwheel.c (gimp_controller_wheel_scroll):
fixed check for modifier keys and always return on a matched
event(bug #480319). Also reordered the list of events as the code
now does not any longer rely on a certain order.
2007-09-26 Sven Neumann <sven@gimp.org>
* plug-ins/maze/maze_face.c: minor cleanup, removed unused code.
......@@ -34,6 +34,9 @@
#include "gimp-intl.h"
#define MODIFIER_MASK (GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK)
typedef struct _WheelEvent WheelEvent;
struct _WheelEvent
......@@ -64,104 +67,104 @@ G_DEFINE_TYPE (GimpControllerWheel, gimp_controller_wheel,
static WheelEvent wheel_events[] =
{
{ GDK_SCROLL_UP, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-up-shift-control-alt",
N_("Scroll Up") },
{ GDK_SCROLL_UP, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"scroll-up-control-alt",
{ GDK_SCROLL_UP, 0,
"scroll-up",
N_("Scroll Up") },
{ GDK_SCROLL_UP, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"scroll-up-shift-alt",
{ GDK_SCROLL_UP, GDK_SHIFT_MASK,
"scroll-up-shift",
N_("Scroll Up") },
{ GDK_SCROLL_UP, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-up-shift-control",
{ GDK_SCROLL_UP, GDK_CONTROL_MASK,
"scroll-up-control",
N_("Scroll Up") },
{ GDK_SCROLL_UP, GDK_MOD1_MASK,
"scroll-up-alt",
N_("Scroll Up") },
{ GDK_SCROLL_UP, GDK_CONTROL_MASK,
"scroll-up-control",
{ GDK_SCROLL_UP, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-up-shift-control",
N_("Scroll Up") },
{ GDK_SCROLL_UP, GDK_SHIFT_MASK,
"scroll-up-shift",
{ GDK_SCROLL_UP, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"scroll-up-shift-alt",
N_("Scroll Up") },
{ GDK_SCROLL_UP, 0,
"scroll-up",
{ GDK_SCROLL_UP, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"scroll-up-control-alt",
N_("Scroll Up") },
{ GDK_SCROLL_UP, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-up-shift-control-alt",
N_("Scroll Up") },
{ GDK_SCROLL_DOWN, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-down-shift-control-alt",
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"scroll-down-control-alt",
{ GDK_SCROLL_DOWN, 0,
"scroll-down",
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"scroll-down-shift-alt",
{ GDK_SCROLL_DOWN, GDK_SHIFT_MASK,
"scroll-down-shift",
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-down-shift-control",
{ GDK_SCROLL_DOWN, GDK_CONTROL_MASK,
"scroll-down-control",
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, GDK_MOD1_MASK,
"scroll-down-alt",
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, GDK_CONTROL_MASK,
"scroll-down-control",
{ GDK_SCROLL_DOWN, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-down-shift-control",
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, GDK_SHIFT_MASK,
"scroll-down-shift",
{ GDK_SCROLL_DOWN, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"scroll-down-shift-alt",
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, 0,
"scroll-down",
{ GDK_SCROLL_DOWN, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"scroll-down-control-alt",
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-down-shift-control-alt",
N_("Scroll Down") },
{ GDK_SCROLL_LEFT, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-left-shift-control-alt",
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"scroll-left-control-alt",
{ GDK_SCROLL_LEFT, 0,
"scroll-left",
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"scroll-left-shift-alt",
{ GDK_SCROLL_LEFT, GDK_SHIFT_MASK,
"scroll-left-shift",
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-left-shift-control",
{ GDK_SCROLL_LEFT, GDK_CONTROL_MASK,
"scroll-left-control",
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, GDK_MOD1_MASK,
"scroll-left-alt",
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, GDK_CONTROL_MASK,
"scroll-left-control",
{ GDK_SCROLL_LEFT, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-left-shift-control",
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, GDK_SHIFT_MASK,
"scroll-left-shift",
{ GDK_SCROLL_LEFT, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"scroll-left-shift-alt",
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, 0,
"scroll-left",
{ GDK_SCROLL_LEFT, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"scroll-left-control-alt",
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-left-shift-control-alt",
N_("Scroll Left") },
{ GDK_SCROLL_RIGHT, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-right-shift-control-alt",
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"scroll-right-control-alt",
{ GDK_SCROLL_RIGHT, 0,
"scroll-right",
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"scroll-right-shift-alt",
{ GDK_SCROLL_RIGHT, GDK_SHIFT_MASK,
"scroll-right-shift",
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-right-shift-control",
{ GDK_SCROLL_RIGHT, GDK_CONTROL_MASK,
"scroll-right-control",
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, GDK_MOD1_MASK,
"scroll-right-alt",
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, GDK_CONTROL_MASK,
"scroll-right-control",
{ GDK_SCROLL_RIGHT, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-right-shift-control",
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, GDK_SHIFT_MASK,
"scroll-right-shift",
{ GDK_SCROLL_RIGHT, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"scroll-right-shift-alt",
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, 0,
"scroll-right",
{ GDK_SCROLL_RIGHT, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"scroll-right-control-alt",
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-right-shift-control-alt",
N_("Scroll Right") }
};
......@@ -264,8 +267,7 @@ gimp_controller_wheel_scroll (GimpControllerWheel *wheel,
{
if (wheel_events[i].direction == sevent->direction)
{
if ((wheel_events[i].modifiers & sevent->state) ==
wheel_events[i].modifiers)
if ((sevent->state & MODIFIER_MASK) == wheel_events[i].modifiers)
{
GimpControllerEvent controller_event;
GimpControllerEventTrigger *trigger;
......@@ -276,11 +278,8 @@ gimp_controller_wheel_scroll (GimpControllerWheel *wheel,
trigger->source = GIMP_CONTROLLER (wheel);
trigger->event_id = i;
if (gimp_controller_event (GIMP_CONTROLLER (wheel),
&controller_event))
{
return TRUE;
}
return gimp_controller_event (GIMP_CONTROLLER (wheel),
&controller_event);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment