diff mcabber/src/screen.h @ 761:4532a9fe0e8c

Handle some keyboard escape sequences Some sequences are not caught by ncurses, so I've made a basic escape sequences interpreter. The patch defines a few sequences for xterm and Gnome terminal (ctrl-arrows).
author Mikael Berthe <mikael@lilotux.net>
date Sun, 19 Mar 2006 12:41:46 +0100
parents 0d5fb1d9077c
children 6866ee749225
line wrap: on
line diff
--- a/mcabber/src/screen.h	Fri Mar 17 17:17:21 2006 +0100
+++ b/mcabber/src/screen.h	Sun Mar 19 12:41:46 2006 +0100
@@ -6,6 +6,16 @@
 
 #include "logprint.h"
 
+// Length of the timestamp & flag prefix in the chat buffer window
+#define PREFIX_WIDTH    17
+
+#define INPUTLINE_LENGTH  1024
+
+// Only used in screen.c; this is the maximum line number
+// in a multi-line message.  Should be < 1000
+// Note: message length is limited by the HBB_BLOCKSIZE size too
+#define MULTILINE_MAX_LINE_NUMBER 299
+
 enum colors {
   COLOR_GENERAL = 3,
   COLOR_HIGHLIGHT,
@@ -19,17 +29,18 @@
 
 int COLOR_ATTRIB[COLOR_max];
 
-// Length of the timestamp & flag prefix in the chat buffer window
-#define PREFIX_WIDTH    17
-
-#define INPUTLINE_LENGTH  1024
+extern int update_roster;
 
-// Only used in screen.c; this is the maximum line number
-// in a multi-line message.  Should be < 1000
-// Note: message length is limited by the HBB_BLOCKSIZE size too
-#define MULTILINE_MAX_LINE_NUMBER 299
+typedef struct {
+  int value;
+  enum {
+    MKEY_META = 1,
+    MKEY_EQUIV
+  } mcode;
+} keycode;
 
-extern int update_roster;
+void scr_Getch(keycode *kcode);
+int process_key(keycode kcode);
 
 void scr_InitCurses(void);
 void scr_TerminateCurses(void);
@@ -51,9 +62,6 @@
 inline const char *scr_get_multiline(void);
 
 inline void scr_Beep(void);
-int scr_Getch(void);
-
-int process_key(int);
 
 void scr_CheckAutoAway(bool activity);