/** @file
* Collection of shorthands to deal with GDK events.
*/
/* Authors:
* Krzysztof KosiĆski <tweenk.pl@gmail.com>
*
* Copyright (C) 2009 Authors
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <cstring>
#include <gdk/gdkkeysyms.h>
#include "display/sp-canvas.h"
#include "ui/tool/event-utils.h"
namespace Inkscape {
namespace UI {
{
0 /*event->key.group*/,
return shortcut_key;
}
{
gint i = 0;
event_next = gdk_event_get();
// while the next event is also a key notify with the same keyval and mask,
i ++;
// kill it
// get next
event_next = gdk_event_get();
}
// otherwise, put it back onto the queue
return i;
}
{
return false;
}
gint i = 0;
event_next = gdk_event_get();
// while the next event is also a motion notify
{
}
}
// kill it
event_next = gdk_event_get();
i++;
}
// otherwise, put it back onto the queue
if (event_next) {
}
return i;
}
/** Returns the modifier state valid after this event. Use this when you process events
* that change the modifier state. Currently handles only Shift, Ctrl, Alt. */
{
unsigned state = 0;
case GDK_KEY_PRESS:
case GDK_KEY_Shift_L:
case GDK_KEY_Shift_R:
state |= GDK_SHIFT_MASK;
break;
case GDK_KEY_Control_L:
case GDK_KEY_Control_R:
break;
case GDK_KEY_Alt_L:
case GDK_KEY_Alt_R:
state |= GDK_MOD1_MASK;
break;
default: break;
}
break;
case GDK_KEY_RELEASE:
case GDK_KEY_Shift_L:
case GDK_KEY_Shift_R:
state &= ~GDK_SHIFT_MASK;
break;
case GDK_KEY_Control_L:
case GDK_KEY_Control_R:
state &= ~GDK_CONTROL_MASK;
break;
case GDK_KEY_Alt_L:
case GDK_KEY_Alt_R:
state &= ~GDK_MOD1_MASK;
break;
default: break;
}
break;
default: break;
}
return state;
}
} // namespace UI
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :