[dia] Bug 614678 - Keypad directional arrows dont work
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] Bug 614678 - Keypad directional arrows dont work
- Date: Fri, 29 Oct 2010 19:27:50 +0000 (UTC)
commit 145ffceb84152870a4e4585a68ad2c298a44f3c2
Author: Hans Breuer <hans breuer org>
Date: Fri Oct 29 20:12:34 2010 +0200
Bug 614678 - Keypad directional arrows dont work
Still not all place are sprinkled by the GDK_KP_* variants
of key-codes, but more than mentioned in the bug report ;)
app/disp_callbacks.c | 4 ++++
lib/text.c | 7 +++++++
2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/app/disp_callbacks.c b/app/disp_callbacks.c
index 3391ec5..667f13f 100644
--- a/app/disp_callbacks.c
+++ b/app/disp_callbacks.c
@@ -872,12 +872,14 @@ ddisplay_canvas_events (GtkWidget *canvas,
switch(kevent->keyval) {
case GDK_Home :
+ case GDK_KP_Home :
/* match upper left corner of the diagram with it's view */
ddisplay_set_origo(ddisp, ddisp->diagram->data->extents.left, ddisp->diagram->data->extents.top);
ddisplay_update_scrollbars(ddisp);
ddisplay_add_update_all(ddisp);
break;
case GDK_End :
+ case GDK_KP_End :
/* match lower right corner of the diagram with it's view */
visible = &ddisp->visible;
ddisplay_set_origo(ddisp,
@@ -887,9 +889,11 @@ ddisplay_canvas_events (GtkWidget *canvas,
ddisplay_add_update_all(ddisp);
break;
case GDK_Page_Up :
+ case GDK_KP_Page_Up :
_scroll_page (ddisp, !(state & GDK_CONTROL_MASK) ? DIR_UP : DIR_LEFT);
break;
case GDK_Page_Down :
+ case GDK_KP_Page_Down :
_scroll_page (ddisp, !(state & GDK_CONTROL_MASK) ? DIR_DOWN : DIR_RIGHT);
break;
case GDK_Up:
diff --git a/lib/text.c b/lib/text.c
index 22b276a..cfc4484 100644
--- a/lib/text.c
+++ b/lib/text.c
@@ -906,6 +906,7 @@ text_key_event(Focus *focus,
switch(keyval) {
case GDK_Up:
+ case GDK_KP_Up:
text->cursor_row--;
if (text->cursor_row<0)
text->cursor_row = 0;
@@ -915,6 +916,7 @@ text_key_event(Focus *focus,
break;
case GDK_Down:
+ case GDK_KP_Down:
text->cursor_row++;
if (text->cursor_row >= text->numlines)
text->cursor_row = text->numlines - 1;
@@ -924,6 +926,7 @@ text_key_event(Focus *focus,
break;
case GDK_Left:
+ case GDK_KP_Left:
if (keystate & GDK_CONTROL_MASK)
text_move_cursor(text, WORD_START);
else
@@ -932,6 +935,7 @@ text_key_event(Focus *focus,
text->cursor_pos = 0;
break;
case GDK_Right:
+ case GDK_KP_Right:
if (keystate & GDK_CONTROL_MASK)
text_move_cursor(text, WORD_END);
else
@@ -940,12 +944,15 @@ text_key_event(Focus *focus,
text->cursor_pos = text_get_line_strlen(text, text->cursor_row);
break;
case GDK_Home:
+ case GDK_KP_Home:
text->cursor_pos = 0;
break;
case GDK_End:
+ case GDK_KP_End:
text->cursor_pos = text_get_line_strlen(text, text->cursor_row);
break;
case GDK_Delete:
+ case GDK_KP_Delete:
return_val = text_delete_key_handler(focus, change);
break;
case GDK_BackSpace:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]