[dia/dia-next: 4/59] Update key names



commit 568929fe774bc7c27e820184456111cac52fed22
Author: Zander Brown <zbrown gnome org>
Date:   Mon Dec 10 23:01:15 2018 +0000

    Update key names

 lib/text.c | 50 +++++++++++++++++++++++++-------------------------
 1 file changed, 25 insertions(+), 25 deletions(-)
---
diff --git a/lib/text.c b/lib/text.c
index 9f58268c..3890f39e 100644
--- a/lib/text.c
+++ b/lib/text.c
@@ -935,8 +935,8 @@ text_key_event(Focus *focus,
   text = focus->text;
 
   switch(keyval) {
-      case GDK_Up:
-      case GDK_KP_Up:
+      case GDK_KEY_Up:
+      case GDK_KEY_KP_Up:
         text->cursor_row--;
         if (text->cursor_row<0)
           text->cursor_row = 0;
@@ -945,8 +945,8 @@ text_key_event(Focus *focus,
           text->cursor_pos = text_get_line_strlen(text, text->cursor_row);
 
         break;
-      case GDK_Down:
-      case GDK_KP_Down:
+      case GDK_KEY_Down:
+      case GDK_KEY_KP_Down:
         text->cursor_row++;
         if (text->cursor_row >= text->numlines)
           text->cursor_row = text->numlines - 1;
@@ -955,8 +955,8 @@ text_key_event(Focus *focus,
           text->cursor_pos = text_get_line_strlen(text, text->cursor_row);
     
         break;
-      case GDK_Left:
-      case GDK_KP_Left:
+      case GDK_KEY_Left:
+      case GDK_KEY_KP_Left:
         if (keystate & GDK_CONTROL_MASK)
          text_move_cursor(text, WORD_START);
        else
@@ -964,8 +964,8 @@ text_key_event(Focus *focus,
         if (text->cursor_pos<0)
           text->cursor_pos = 0;
         break;
-      case GDK_Right:
-      case GDK_KP_Right:
+      case GDK_KEY_Right:
+      case GDK_KEY_KP_Right:
         if (keystate & GDK_CONTROL_MASK)
          text_move_cursor(text, WORD_END);
        else
@@ -973,19 +973,19 @@ text_key_event(Focus *focus,
         if (text->cursor_pos > text_get_line_strlen(text, text->cursor_row))
           text->cursor_pos = text_get_line_strlen(text, text->cursor_row);
         break;
-      case GDK_Home:
-      case GDK_KP_Home:
+      case GDK_KEY_Home:
+      case GDK_KEY_KP_Home:
         text->cursor_pos = 0;
         break;
-      case GDK_End:
-      case GDK_KP_End:
+      case GDK_KEY_End:
+      case GDK_KEY_KP_End:
         text->cursor_pos = text_get_line_strlen(text, text->cursor_row);
         break;
-      case GDK_Delete:
-      case GDK_KP_Delete:
+      case GDK_KEY_Delete:
+      case GDK_KEY_KP_Delete:
         return_val = text_delete_key_handler(focus, change);
         break;
-      case GDK_BackSpace:
+      case GDK_KEY_BackSpace:
         return_val = TRUE;
         row = text->cursor_row;
         if (text->cursor_pos <= 0) {
@@ -1009,22 +1009,22 @@ text_key_event(Focus *focus,
         }
         text_delete_backward(text);
         break;
-      case GDK_Return:
-      case GDK_KP_Enter:
+      case GDK_KEY_Return:
+      case GDK_KEY_KP_Enter:
         return_val = TRUE;
         *change = text_create_change(text, TYPE_SPLIT_ROW, 'Q',
                                      text->cursor_pos, text->cursor_row,
                                     focus->obj);
         text_split_line(text);
         break;
-      case GDK_Shift_L:
-      case GDK_Shift_R:
-      case GDK_Control_L:
-      case GDK_Control_R:
-      case GDK_Alt_L:
-      case GDK_Alt_R:
-      case GDK_Meta_L:
-      case GDK_Meta_R:
+      case GDK_KEY_Shift_L:
+      case GDK_KEY_Shift_R:
+      case GDK_KEY_Control_L:
+      case GDK_KEY_Control_R:
+      case GDK_KEY_Alt_L:
+      case GDK_KEY_Alt_R:
+      case GDK_KEY_Meta_L:
+      case GDK_KEY_Meta_R:
         return_val = FALSE; /* no text change for modifiers */
         break;
       default:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]