diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-11-21 03:45:10 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-11-21 03:45:10 +0000 |
| commit | 419bde4d72fd64e6ec9c5ff5d906730d197c84d7 (patch) | |
| tree | 3e378be6bbeb1afa7e45676cb8ed3fc8b104b8ae /src/node-context.cpp | |
| parent | fix gobble_key_events so it also handles release events (diff) | |
| download | inkscape-419bde4d72fd64e6ec9c5ff5d906730d197c84d7.tar.gz inkscape-419bde4d72fd64e6ec9c5ff5d906730d197c84d7.zip | |
use gobble_key_events to speed up keyboard moves
(bzr r4121)
Diffstat (limited to '')
| -rw-r--r-- | src/node-context.cpp | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/src/node-context.cpp b/src/node-context.cpp index 56b6dd760..3e7903227 100644 --- a/src/node-context.cpp +++ b/src/node-context.cpp @@ -486,13 +486,15 @@ sp_node_context_root_handler(SPEventContext *event_context, GdkEvent *event) case GDK_KP_Left: case GDK_KP_4: if (!MOD__CTRL) { // not ctrl + gint mul = 1 + gobble_key_events( + get_group0_keyval(&event->key), 0); // with any mask if (MOD__ALT) { // alt - if (MOD__SHIFT) nc->shape_editor->move_nodes_screen(-10, 0); // shift - else nc->shape_editor->move_nodes_screen(-1, 0); // no shift + if (MOD__SHIFT) nc->shape_editor->move_nodes_screen(mul*-10, 0); // shift + else nc->shape_editor->move_nodes_screen(mul*-1, 0); // no shift } else { // no alt - if (MOD__SHIFT) nc->shape_editor->move_nodes(-10*nudge, 0); // shift - else nc->shape_editor->move_nodes(-nudge, 0); // no shift + if (MOD__SHIFT) nc->shape_editor->move_nodes(mul*-10*nudge, 0); // shift + else nc->shape_editor->move_nodes(mul*-nudge, 0); // no shift } ret = TRUE; } @@ -501,13 +503,15 @@ sp_node_context_root_handler(SPEventContext *event_context, GdkEvent *event) case GDK_KP_Up: case GDK_KP_8: if (!MOD__CTRL) { // not ctrl + gint mul = 1 + gobble_key_events( + get_group0_keyval(&event->key), 0); // with any mask if (MOD__ALT) { // alt - if (MOD__SHIFT) nc->shape_editor->move_nodes_screen(0, 10); // shift - else nc->shape_editor->move_nodes_screen(0, 1); // no shift + if (MOD__SHIFT) nc->shape_editor->move_nodes_screen(0, mul*10); // shift + else nc->shape_editor->move_nodes_screen(0, mul*1); // no shift } else { // no alt - if (MOD__SHIFT) nc->shape_editor->move_nodes(0, 10*nudge); // shift - else nc->shape_editor->move_nodes(0, nudge); // no shift + if (MOD__SHIFT) nc->shape_editor->move_nodes(0, mul*10*nudge); // shift + else nc->shape_editor->move_nodes(0, mul*nudge); // no shift } ret = TRUE; } @@ -516,13 +520,15 @@ sp_node_context_root_handler(SPEventContext *event_context, GdkEvent *event) case GDK_KP_Right: case GDK_KP_6: if (!MOD__CTRL) { // not ctrl + gint mul = 1 + gobble_key_events( + get_group0_keyval(&event->key), 0); // with any mask if (MOD__ALT) { // alt - if (MOD__SHIFT) nc->shape_editor->move_nodes_screen(10, 0); // shift - else nc->shape_editor->move_nodes_screen(1, 0); // no shift + if (MOD__SHIFT) nc->shape_editor->move_nodes_screen(mul*10, 0); // shift + else nc->shape_editor->move_nodes_screen(mul*1, 0); // no shift } else { // no alt - if (MOD__SHIFT) nc->shape_editor->move_nodes(10*nudge, 0); // shift - else nc->shape_editor->move_nodes(nudge, 0); // no shift + if (MOD__SHIFT) nc->shape_editor->move_nodes(mul*10*nudge, 0); // shift + else nc->shape_editor->move_nodes(mul*nudge, 0); // no shift } ret = TRUE; } @@ -531,13 +537,15 @@ sp_node_context_root_handler(SPEventContext *event_context, GdkEvent *event) case GDK_KP_Down: case GDK_KP_2: if (!MOD__CTRL) { // not ctrl + gint mul = 1 + gobble_key_events( + get_group0_keyval(&event->key), 0); // with any mask if (MOD__ALT) { // alt - if (MOD__SHIFT) nc->shape_editor->move_nodes_screen(0, -10); // shift - else nc->shape_editor->move_nodes_screen(0, -1); // no shift + if (MOD__SHIFT) nc->shape_editor->move_nodes_screen(0, mul*-10); // shift + else nc->shape_editor->move_nodes_screen(0, mul*-1); // no shift } else { // no alt - if (MOD__SHIFT) nc->shape_editor->move_nodes(0, -10*nudge); // shift - else nc->shape_editor->move_nodes(0, -nudge); // no shift + if (MOD__SHIFT) nc->shape_editor->move_nodes(0, mul*-10*nudge); // shift + else nc->shape_editor->move_nodes(0, mul*-nudge); // no shift } ret = TRUE; } |
