#include "haiku_support.h"
+/* Some messages that Emacs sends to itself. */
enum
{
SCROLL_BAR_UPDATE = 3000,
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;
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;
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: