[gcalctool] Allow whitespace to be entered
- From: Robert Ancell <rancell src gnome org>
- To: svn-commits-list gnome org
- Subject: [gcalctool] Allow whitespace to be entered
- Date: Mon, 27 Jul 2009 01:03:12 +0000 (UTC)
commit ce85bb6f3b57c8f8f2e456c242bc4ef8c7cce0c3
Author: Robert Ancell <robert ancell gmail com>
Date: Mon Jul 27 11:03:05 2009 +1000
Allow whitespace to be entered
src/functions.c | 1 +
src/functions.h | 1 +
src/gtk.c | 6 ++++++
3 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/functions.c b/src/functions.c
index ba66354..307d20b 100644
--- a/src/functions.c
+++ b/src/functions.c
@@ -51,6 +51,7 @@ typedef struct {
/* Note that none of these strings can be translated as the parser expects them to be correct */
/* id, symname flags */
static Function functions[NFUNCTIONS] = {
+{ FN_SPACE, " ", 0},
{ FN_0, "0", NUMBER },
{ FN_1, "1", NUMBER },
{ FN_2, "2", NUMBER },
diff --git a/src/functions.h b/src/functions.h
index 4713531..ff3290c 100644
--- a/src/functions.h
+++ b/src/functions.h
@@ -26,6 +26,7 @@
/* Available functions */
enum
{
+ FN_SPACE,
FN_0, FN_1, FN_2, FN_3,
FN_4, FN_5, FN_6, FN_7,
FN_8, FN_9, FN_A, FN_B,
diff --git a/src/gtk.c b/src/gtk.c
index 1c971fd..3fe391c 100644
--- a/src/gtk.c
+++ b/src/gtk.c
@@ -2134,6 +2134,12 @@ main_window_key_press_cb(GtkWidget *widget, GdkEventKey *event)
}
}
+ /* Whitespace */
+ if (event->keyval == GDK_space && state == 0) {
+ do_button(FN_SPACE, 0);
+ return TRUE;
+ }
+
/* Delete in display */
if (event->keyval == GDK_Delete && state == 0 && (event->state & GDK_SHIFT_MASK) == 0) {
do_button(FN_DELETE, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]