summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bb3043e)
raw | patch | inline | side by side (parent: bb3043e)
author | gustav_b <gustav_b@users.sourceforge.net> | |
Wed, 19 Sep 2007 09:31:03 +0000 (09:31 +0000) | ||
committer | gustav_b <gustav_b@users.sourceforge.net> | |
Wed, 19 Sep 2007 09:31:03 +0000 (09:31 +0000) |
src/ui/dialog/dialog.cpp | patch | blob | history |
index cb9ea02262c7ff3aaf371d2ee1d2672a25bbe08d..4fbc217abefb59b856b14195cf219dfc75db7d88 100644 (file)
--- a/src/ui/dialog/dialog.cpp
+++ b/src/ui/dialog/dialog.cpp
switch (event->type) {
case GDK_KEY_PRESS: {
- ret = _onKeyPress(&event->key);
- break;
+ switch (get_group0_keyval (&event->key)) {
+ case GDK_Escape: {
+ _defocus();
+ ret = true;
+ break;
+ }
+ case GDK_F4:
+ case GDK_w:
+ case GDK_W: {
+ if (mod_ctrl_only(event->key.state)) {
+ _close();
+ ret = true;
+ }
+ break;
+ }
+ default: { // pass keypress to the canvas
+ break;
+ }
+ }
}
default:
;
bool
Dialog::_onKeyPress(GdkEventKey *event)
{
- bool ret = false;
- switch (get_group0_keyval (event)) {
- case GDK_Escape: {
- _defocus();
- ret = true;
- break;
- }
- case GDK_F4:
- case GDK_w:
- case GDK_W: {
- if (mod_ctrl_only(event->state)) {
- _close();
- ret = true;
- }
- break;
- }
- default: { // pass keypress to the canvas
- unsigned int shortcut;
- shortcut = get_group0_keyval (event) |
- ( event->state & GDK_SHIFT_MASK ?
- SP_SHORTCUT_SHIFT_MASK : 0 ) |
- ( event->state & GDK_CONTROL_MASK ?
- SP_SHORTCUT_CONTROL_MASK : 0 ) |
- ( event->state & GDK_MOD1_MASK ?
- SP_SHORTCUT_ALT_MASK : 0 );
- sp_shortcut_invoke( shortcut, SP_ACTIVE_DESKTOP );
- break;
- }
- }
-
- return ret;
+ unsigned int shortcut;
+ shortcut = get_group0_keyval(event) |
+ ( event->state & GDK_SHIFT_MASK ?
+ SP_SHORTCUT_SHIFT_MASK : 0 ) |
+ ( event->state & GDK_CONTROL_MASK ?
+ SP_SHORTCUT_CONTROL_MASK : 0 ) |
+ ( event->state & GDK_MOD1_MASK ?
+ SP_SHORTCUT_ALT_MASK : 0 );
+ return sp_shortcut_invoke(shortcut, SP_ACTIVE_DESKTOP);
}
void