aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-10-19 12:49:47 +0800
committerChris Lahey <clahey@src.gnome.org>2000-10-19 12:49:47 +0800
commit4a7322cfec7bdf8f98831e550d6ed53acddbe9d6 (patch)
treee04cd81a1d84998fb47bba83e63879c44ec77bf3 /e-util
parent66da354765a8578ed6f7cf7ef402863cd4bf9884 (diff)
downloadgsoc2013-evolution-4a7322cfec7bdf8f98831e550d6ed53acddbe9d6.tar.gz
gsoc2013-evolution-4a7322cfec7bdf8f98831e550d6ed53acddbe9d6.tar.zst
gsoc2013-evolution-4a7322cfec7bdf8f98831e550d6ed53acddbe9d6.zip
Made the number keys on the number pad work in ETexts and ECellTexts.
2000-10-19 Christopher James Lahey <clahey@helixcode.com> * gal/e-text/e-text-event-processor-emacs-like.c: Made the number keys on the number pad work in ETexts and ECellTexts. svn path=/trunk/; revision=6027
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-text-event-processor-emacs-like.c109
1 files changed, 108 insertions, 1 deletions
diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c
index 07c39c93a9..2910ec36ab 100644
--- a/e-util/e-text-event-processor-emacs-like.c
+++ b/e-util/e-text-event-processor-emacs-like.c
@@ -318,7 +318,110 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, ETextEventPro
command.action = E_TEP_NOP;
command.position = E_TEP_SELECTION;
break;
-
+
+ case GDK_KP_Space:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = " ";
+ break;
+ case GDK_KP_Equal:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "=";
+ break;
+ case GDK_KP_Multiply:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "*";
+ break;
+ case GDK_KP_Add:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "+";
+ break;
+ case GDK_KP_Subtract:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "-";
+ break;
+ case GDK_KP_Decimal:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = ".";
+ break;
+ case GDK_KP_Divide:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "/";
+ break;
+ case GDK_KP_0:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "0";
+ break;
+ case GDK_KP_1:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "1";
+ break;
+ case GDK_KP_2:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "2";
+ break;
+ case GDK_KP_3:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "3";
+ break;
+ case GDK_KP_4:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "4";
+ break;
+ case GDK_KP_5:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "5";
+ break;
+ case GDK_KP_6:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "6";
+ break;
+ case GDK_KP_7:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "7";
+ break;
+ case GDK_KP_8:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "8";
+ break;
+ case GDK_KP_9:
+ command.action = E_TEP_INSERT;
+ command.position = E_TEP_SELECTION;
+ command.value = 1;
+ command.string = "9";
+ break;
+
default:
if (key.state & GDK_CONTROL_MASK) {
if ((key.keyval >= 'A') && (key.keyval <= 'Z'))
@@ -354,6 +457,10 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, ETextEventPro
command.string = alt_keys[(int) (key.keyval - 'a')].string;
}
} else if (key.length > 0) {
+ if (key.keyval >= GDK_KP_0 && key.keyval <= GDK_KP_9) {
+ key.keyval = '0';
+ key.string = "0";
+ }
command.action = E_TEP_INSERT;
command.position = E_TEP_SELECTION;
command.value = strlen(key.string);