summaryrefslogtreecommitdiffstats
path: root/src/text-context.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2007-11-21 03:45:10 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2007-11-21 03:45:10 +0000
commit419bde4d72fd64e6ec9c5ff5d906730d197c84d7 (patch)
tree3e378be6bbeb1afa7e45676cb8ed3fc8b104b8ae /src/text-context.cpp
parentfix gobble_key_events so it also handles release events (diff)
downloadinkscape-419bde4d72fd64e6ec9c5ff5d906730d197c84d7.tar.gz
inkscape-419bde4d72fd64e6ec9c5ff5d906730d197c84d7.zip
use gobble_key_events to speed up keyboard moves
(bzr r4121)
Diffstat (limited to 'src/text-context.cpp')
-rw-r--r--src/text-context.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/text-context.cpp b/src/text-context.cpp
index 579309c1e..6ebd6c959 100644
--- a/src/text-context.cpp
+++ b/src/text-context.cpp
@@ -999,10 +999,12 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
case GDK_KP_4:
if (tc->text) {
if (MOD__ALT) {
+ gint mul = 1 + gobble_key_events(
+ get_group0_keyval(&event->key), 0); // with any mask
if (MOD__SHIFT)
- sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(-10, 0));
+ sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(mul*-10, 0));
else
- sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(-1, 0));
+ sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(mul*-1, 0));
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_maybe_done(sp_desktop_document(desktop), "kern:left", SP_VERB_CONTEXT_TEXT,
@@ -1019,10 +1021,12 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
case GDK_KP_6:
if (tc->text) {
if (MOD__ALT) {
+ gint mul = 1 + gobble_key_events(
+ get_group0_keyval(&event->key), 0); // with any mask
if (MOD__SHIFT)
- sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(10, 0));
+ sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(mul*10, 0));
else
- sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(1, 0));
+ sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(mul*1, 0));
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_maybe_done(sp_desktop_document(desktop), "kern:right", SP_VERB_CONTEXT_TEXT,
@@ -1039,10 +1043,12 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
case GDK_KP_8:
if (tc->text) {
if (MOD__ALT) {
+ gint mul = 1 + gobble_key_events(
+ get_group0_keyval(&event->key), 0); // with any mask
if (MOD__SHIFT)
- sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(0, -10));
+ sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(0, mul*-10));
else
- sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(0, -1));
+ sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(0, mul*-1));
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_maybe_done(sp_desktop_document(desktop), "kern:up", SP_VERB_CONTEXT_TEXT,
@@ -1060,10 +1066,12 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
case GDK_KP_2:
if (tc->text) {
if (MOD__ALT) {
+ gint mul = 1 + gobble_key_events(
+ get_group0_keyval(&event->key), 0); // with any mask
if (MOD__SHIFT)
- sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(0, 10));
+ sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(0, mul*10));
else
- sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(0, 1));
+ sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, NR::Point(0, mul*1));
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
sp_document_maybe_done(sp_desktop_document(desktop), "kern:down", SP_VERB_CONTEXT_TEXT,