]> git.eshelyaron.com Git - emacs.git/commitdiff
Clean up keysyms from Haiku headers
authorPo Lu <luangruo@yahoo.com>
Fri, 15 Apr 2022 11:57:14 +0000 (11:57 +0000)
committerPo Lu <luangruo@yahoo.com>
Fri, 15 Apr 2022 12:00:35 +0000 (12:00 +0000)
* src/haiku_support.cc (keysym_from_raw_char): Add keysym
numbers here and use those instead.
* src/haiku_support.h: Delete all the X11 keysym definitions.

src/haiku_support.cc
src/haiku_support.h

index 4fd2fc4aa5e734fcd257debd0cb38d3d67003b9a..ddcd908fd257d0c81731cf0190be18bf285fc3a8 100644 (file)
@@ -81,6 +81,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include "haiku_support.h"
 
+/* Some messages that Emacs sends to itself.  */
 enum
   {
     SCROLL_BAR_UPDATE  = 3000,
@@ -92,6 +93,29 @@ enum
     QUIT_APPLICATION   = 3006,
   };
 
+/* X11 keysyms that we use.  */
+enum
+  {
+    KEY_BACKSPACE   = 0xff08,
+    KEY_TAB        = 0xff09,
+    KEY_RETURN     = 0xff0d,
+    KEY_PAUSE      = 0xff13,
+    KEY_ESCAPE     = 0xff1b,
+    KEY_DELETE     = 0xffff,
+    KEY_HOME       = 0xff50,
+    KEY_LEFT_ARROW  = 0xff51,
+    KEY_UP_ARROW    = 0xff52,
+    KEY_RIGHT_ARROW = 0xff53,
+    KEY_DOWN_ARROW  = 0xff54,
+    KEY_PAGE_UP            = 0xff55,
+    KEY_PAGE_DOWN   = 0xff56,
+    KEY_END        = 0xff57,
+    KEY_PRINT      = 0xff61,
+    KEY_INSERT     = 0xff63,
+    /* This is used to indicate the first function key.  */
+    KEY_F1         = 0xffbe,
+  };
+
 static color_space dpy_color_space = B_NO_COLOR_SPACE;
 static key_map *key_map = NULL;
 static char *key_chars = NULL;
@@ -219,62 +243,62 @@ keysym_from_raw_char (int32 raw, int32 key, unsigned *code)
   switch (raw)
     {
     case B_BACKSPACE:
-      *code = XK_BackSpace;
+      *code = KEY_BACKSPACE;
       break;
     case B_RETURN:
-      *code = XK_Return;
+      *code = KEY_RETURN;
       break;
     case B_TAB:
-      *code = XK_Tab;
+      *code = KEY_TAB;
       break;
     case B_ESCAPE:
-      *code = XK_Escape;
+      *code = KEY_ESCAPE;
       break;
     case B_LEFT_ARROW:
-      *code = XK_Left;
+      *code = KEY_LEFT_ARROW;
       break;
     case B_RIGHT_ARROW:
-      *code = XK_Right;
+      *code = KEY_RIGHT_ARROW;
       break;
     case B_UP_ARROW:
-      *code = XK_Up;
+      *code = KEY_UP_ARROW;
       break;
     case B_DOWN_ARROW:
-      *code = XK_Down;
+      *code = KEY_DOWN_ARROW;
       break;
     case B_INSERT:
-      *code = XK_Insert;
+      *code = KEY_INSERT;
       break;
     case B_DELETE:
-      *code = XK_Delete;
+      *code = KEY_DELETE;
       break;
     case B_HOME:
-      *code = XK_Home;
+      *code = KEY_HOME;
       break;
     case B_END:
-      *code = XK_End;
+      *code = KEY_END;
       break;
     case B_PAGE_UP:
-      *code = XK_Page_Up;
+      *code = KEY_PAGE_UP;
       break;
     case B_PAGE_DOWN:
-      *code = XK_Page_Down;
+      *code = KEY_PAGE_DOWN;
       break;
 
     case B_FUNCTION_KEY:
-      *code = XK_F1 + key - 2;
+      *code = KEY_F1 + key - 2;
 
-      if (*code - XK_F1 == 12)
-       *code = XK_Print;
-      else if (*code - XK_F1 == 13)
+      if (*code - KEY_F1 == 12)
+       *code = KEY_PRINT;
+      else if (*code - KEY_F1 == 13)
        /* Okay, Scroll Lock is a bit too much: keyboard.c doesn't
           know about it yet, and it shouldn't, since that's a
           modifier key.
 
-          *code = XK_Scroll_Lock; */
+          *code = KEY_SCROLL_LOCK; */
        return -1;
-      else if (*code - XK_F1 == 14)
-       *code = XK_Pause;
+      else if (*code - KEY_F1 == 14)
+       *code = KEY_PAUSE;
 
       break;
 
index eb54fe75dd9ce828df7451563f6a1746366241ad..237cedd8fc2b349c7e29b38f7c27c5dd45ba0de9 100644 (file)
@@ -638,44 +638,6 @@ extern void *find_appropriate_view_for_draw (void *vw);
 extern _Noreturn void gui_abort (const char *msg);
 #endif /* _cplusplus */
 
-/* Borrowed from X.Org keysymdef.h */
-#define XK_BackSpace                     0xff08  /* Back space, back char */
-#define XK_Tab                           0xff09
-#define XK_Linefeed                      0xff0a  /* Linefeed, LF */
-#define XK_Clear                         0xff0b
-#define XK_Return                        0xff0d  /* Return, enter */
-#define XK_Pause                         0xff13  /* Pause, hold */
-#define XK_Scroll_Lock                   0xff14
-#define XK_Sys_Req                       0xff15
-#define XK_Escape                        0xff1b
-#define XK_Delete                        0xffff  /* Delete, rubout */
-#define XK_Home                          0xff50
-#define XK_Left                          0xff51  /* Move left, left arrow */
-#define XK_Up                            0xff52  /* Move up, up arrow */
-#define XK_Right                         0xff53  /* Move right, right arrow */
-#define XK_Down                          0xff54  /* Move down, down arrow */
-#define XK_Prior                         0xff55  /* Prior, previous */
-#define XK_Page_Up                       0xff55
-#define XK_Next                          0xff56  /* Next */
-#define XK_Page_Down                     0xff56
-#define XK_End                           0xff57  /* EOL */
-#define XK_Begin                         0xff58  /* BOL */
-#define XK_Select                        0xff60  /* Select, mark */
-#define XK_Print                         0xff61
-#define XK_Execute                       0xff62  /* Execute, run, do */
-#define XK_Insert                        0xff63  /* Insert, insert here */
-#define XK_Undo                          0xff65
-#define XK_Redo                          0xff66  /* Redo, again */
-#define XK_Menu                          0xff67
-#define XK_Find                          0xff68  /* Find, search */
-#define XK_Cancel                        0xff69  /* Cancel, stop, abort, exit */
-#define XK_Help                          0xff6a  /* Help */
-#define XK_Break                         0xff6b
-#define XK_Mode_switch                   0xff7e  /* Character set switch */
-#define XK_script_switch                 0xff7e  /* Alias for mode_switch */
-#define XK_Num_Lock                      0xff7f
-#define XK_F1                            0xffbe
-
 #endif /* _HAIKU_SUPPORT_H_ */
 
 // Local Variables: