diff --git a/.gitattributes b/.gitattributes
index 8a9825282fbe1ed2e7177f687c9eebf9c9efb07e..14d8b51f7b183be6b091cd627ee1131a207303f8 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,5 +1,6 @@
 [attr]binary -text -crlf -diff -ident
 * text ident
+*.db binary
 *.gif binary
 *.gz binary
 *.ppm binary
diff --git a/lib/modules/Protocols.pmod/X.pmod/Requests.pmod b/lib/modules/Protocols.pmod/X.pmod/Requests.pmod
index 18989997ec159d0f5b58bc3edb6eb2cffbbdfc52..f69be396966233e1ce8fb9f0059ad81496c92596 100644
--- a/lib/modules/Protocols.pmod/X.pmod/Requests.pmod
+++ b/lib/modules/Protocols.pmod/X.pmod/Requests.pmod
@@ -7,7 +7,7 @@
 class request
 {
   constant type = 0;
-  constant expect_reply = 0;
+//   constant expect_reply = 0;
 
   array build_value_list(mapping m, array(string) fields)
   {
@@ -21,8 +21,8 @@ class request
 	  {
 	    v += ({ objectp(m[f]) ? m[f]->id : m[f] });
 	    mask |= bit;
-	    werror(sprintf("Request->build_value_list: field %s, mask = %x\n",
-			   f, mask));
+// 	    werror(sprintf("Request->build_value_list: field %s, mask = %x\n",
+// 			   f, mask));
 	  }
 	bit <<= 1;
       }
@@ -41,6 +41,12 @@ class request
     error("Xlib.request: unexpected reply!\n");
     return 0;
   }
+
+  mixed handle_error(string reply)
+  {
+    error("Xlib.request: unexpected reply!\n");
+    return 0;
+  }
 }
 
 class ResourceReq
@@ -109,6 +115,53 @@ class MapWindow
   constant type = 8;
 }
 
+class GetKeyboardMapping
+{
+  inherit request;
+  constant type = 101;
+  int first=0;
+  int num=0;
+
+  string to_string()
+  {
+    return build_request( sprintf("%c%c\0\0", first, num) );
+  }
+
+  mixed handle_reply(mapping reply)
+  {
+    int nkc = (reply->data1-4)*4;
+    string format;
+    if(nkc>0)
+      format = "%4c%4c%4c%4c%*"+nkc+"c%s";
+    else if(!nkc)
+      format = "%4c%4c%4c%4c%s";
+    else if(nkc==-4)
+      format = "%4c%4c%4c%s";
+    else if(nkc==-8)
+      format = "%4c%4c%s";
+    else if(nkc==-16)
+      format = "%4c%s";
+
+    array res = allocate(256);
+    reply->rest = reply->rest[24..]; // ?
+    for(int i=first; i<num+first; i++)
+    {
+      array foo = allocate(4);
+      sscanf(reply->rest, format, foo[0],foo[1],foo[2],foo[3],reply->rest);
+      if(foo[3]==foo[2] && !foo[2])
+	foo = foo[..1]+foo[..1];
+      res[i]=replace(foo, 0,((foo-({0}))+({0}))[0]);
+    }
+    return res;
+  }
+
+  mixed handle_error(string reply)
+  {
+    error("Xlib.request: unexpected reply!\n");
+    return 0;
+  }
+}
+
 class ConfigureWindow
 {
   inherit request;
diff --git a/lib/modules/Protocols.pmod/X.pmod/Types.pmod b/lib/modules/Protocols.pmod/X.pmod/Types.pmod
index 704ebc991bb3481f1c5a1e2c19889f923c8597ca..725fe577134a10494788c31f6ba3762ea376aa2d 100644
--- a/lib/modules/Protocols.pmod/X.pmod/Types.pmod
+++ b/lib/modules/Protocols.pmod/X.pmod/Types.pmod
@@ -183,6 +183,165 @@ class Window
   int currentInputMask;
 
   mapping(string:function) event_callbacks = ([ ]);
+
+  int alt_gr, num_lock, shift, control, caps_lock;
+  int meta, alt, super, hyper;
+
+#include "keysyms.h"
+
+  void ReleaseKey( int sym )
+  {
+    switch(sym)
+    {
+     case XK_Scroll_Lock: return 0; break;
+     case XK_Mode_switch:  alt_gr = 0; return 0;
+     case XK_Num_Lock:    num_lock = 0; return 0;
+     case XK_Shift_L:
+     case XK_Shift_Lock:
+     case XK_Shift_R:     shift=0; return 0;
+     case XK_Control_L:
+     case XK_Control_R:   control=0; return 0;
+     case XK_Caps_Lock:  caps_lock=0; return 0;
+
+     case XK_Meta_L:
+     case XK_Meta_R:   meta=0; return 0;
+     case XK_Alt_L:
+     case XK_Alt_R:   alt=0; return 0;
+     case XK_Super_L:
+     case XK_Super_R:   super=0; return 0;
+     case XK_Hyper_L:
+     case XK_Hyper_R:   hyper=0; return 0;
+    }
+  }
+
+  string _LookupKeysym( int keysym )
+  {
+    switch(keysym)
+    {
+     case XK_BackSpace:   return "";
+     case XK_Tab:         return "\t";
+     case XK_Linefeed:    return "\n";
+     case XK_Return:      return "\n";
+     case XK_Escape:      return "";
+     case XK_Delete:      return "";
+       /* Kanji here ... */
+       /* Korean here ... */
+       /* Cursors ... */
+     case XK_KP_Space:       return " ";
+     case XK_KP_Tab:         return "\t";
+     case XK_KP_Equal:       return "=";
+     case XK_KP_Multiply:    return "*";
+     case XK_KP_Add:         return "+";
+     case XK_KP_Subtract:    return "-";
+     case XK_KP_Decimal:     return ".";
+     case XK_KP_Divide:      return "/";
+
+     case XK_KP_0:      return "0";
+     case XK_KP_1:      return "1";
+     case XK_KP_2:      return "2";
+     case XK_KP_3:      return "3";
+     case XK_KP_4:      return "4";
+     case XK_KP_5:      return "5";
+     case XK_KP_6:      return "6";
+     case XK_KP_7:      return "7";
+     case XK_KP_8:      return "8";
+     case XK_KP_9:      return "9";
+
+     case XK_space..XK_at:     return sprintf("%c", keysym);
+     case XK_A..XK_Z: 
+     case XK_a..XK_z:  
+       keysym = keysym&0xdf;
+       if(control) return sprintf("%c", (keysym-'A')+1);
+       if(shift || caps_lock) return sprintf("%c",keysym);
+       return sprintf("%c",keysym+0x20);
+
+     default:
+       if(keysym < 256)
+	 return sprintf("%c", keysym);
+       return 0;
+       /*Latin2 .. latin3 .. latin4 .. katakana .. arabic .. cyrillic ..
+	 greek .. technical .. special .. publishing .. APL .. hebrew ..
+	 thai .. korean .. hangul .. */
+    }
+  } 
+
+  // FIXME! Should use some sort of (global..) db.
+  mapping compose_patterns = decode_value(Stdio.read_bytes("db/compose.db"));
+  string compose_state = "";
+  string LookupKeysym( int keysym )
+  {
+    switch(keysym)
+    {
+     case XK_A..XK_Z: 
+     case XK_a..XK_z:  /* Uäääärk */
+       keysym = keysym&0xdf;
+       if(!shift && !caps_lock)
+	 keysym=keysym+0x20;
+       break;
+
+     case XK_Mode_switch:  alt_gr = 1; return 0;
+     case XK_Num_Lock:    num_lock = 1; return 0;
+     case XK_Shift_L:
+     case XK_Shift_Lock:
+     case XK_Shift_R:     shift=1; return 0;
+     case XK_Control_L:
+     case XK_Control_R:   control=1; return 0;
+     case XK_Caps_Lock:  caps_lock=1; return 0;
+     case XK_Meta_L:
+     case XK_Meta_R:   meta=1; return 0;
+     case XK_Alt_L:
+     case XK_Alt_R:   alt=1; return 0;
+     case XK_Super_L:
+     case XK_Super_R:   super=1; return 0;
+     case XK_Hyper_L:
+     case XK_Hyper_R:   hyper=1; return 0;
+    }
+
+
+    compose_state += sprintf("%4c", keysym);
+    if(arrayp(compose_patterns[compose_state]))
+      return 0;
+    if(keysym)
+    {
+      keysym = compose_patterns[compose_state];
+      compose_state="";
+      return _LookupKeysym( keysym );
+    }
+    if(strlen(compose_state)>4)
+    {
+      string res="";
+      while(strlen(compose_state)
+	    && (sscanf(compose_state, "%4c%s", keysym, compose_state)==2))
+	res += _LookupKeysym( keysym ) || "";
+      return strlen(res)?res:0;
+    }
+    compose_state="";
+    return _LookupKeysym( keysym );
+  }
+
+
+  string handle_keys(mapping evnt)
+  {
+    int code=evnt->detail, keysym;
+    evnt->keycode = code;
+
+    array keysymopts = display->key_mapping[ code ];
+//     werror(sprintf("%d%d", shift,alt_gr));
+    keysym = keysymopts[ alt_gr*2+shift ];
+//     werror(sprintf("<%d{%{%d,%}}> ", keysym,keysymopts));
+
+    if( keysym )
+      if(evnt->type == "KeyPress")
+      {
+	evnt->data = LookupKeysym( keysym );
+	if(evnt->data)
+	  werror("("+evnt->data+") ");
+      }
+      else
+	foreach(keysymopts, int k)
+	  ReleaseKey( k );
+    evnt->keysym = keysym;
+  }
   
   object CreateWindow_req(int x, int y, int width, int height,
 			  int border_width)
@@ -327,6 +486,14 @@ class Window
   {
     display->send_request(Map_req());
   }
+
+
+  void create(mixed ... args)
+  {
+    ::create( @args );
+    set_event_callback("_KeyPress", handle_keys);
+    set_event_callback("_KeyRelease", handle_keys);
+  }
 }
 
 class Colormap
diff --git a/lib/modules/Protocols.pmod/X.pmod/Xlib.pmod b/lib/modules/Protocols.pmod/X.pmod/Xlib.pmod
index c149e5ebb93fa418b6ccf6a82e6e29e1394cdc00..0ef19f0ebdcb13c0bcacde6a1e7904120c1c42b2 100644
--- a/lib/modules/Protocols.pmod/X.pmod/Xlib.pmod
+++ b/lib/modules/Protocols.pmod/X.pmod/Xlib.pmod
@@ -150,6 +150,8 @@ class Display
   int bitmapScanlineUnit, bitmapScanlinePad;
   int minKeyCode, maxKeyCode;
 
+  array key_mapping ;
+
   mapping pending_requests; /* Pending requests */
   object pending_actions;   /* Actions awaiting handling */
 
@@ -174,7 +176,7 @@ class Display
 
   void send(string data)
   {
-    werror(sprintf("Xlib.Display->send: '%s'\n", data));
+//     werror(sprintf("Xlib.Display->send: '%s'\n", data));
     buffer += data;
     if (strlen(buffer))
       set_write_callback(write_callback);
@@ -215,17 +217,25 @@ class Display
     object w;
 
     if (event->wid && (w = lookup_id(event->wid))
-	&& (w->event_callbacks[event->type]))
-      w->event_callbacks[event->type](event);
+	&& ((w->event_callbacks["_"+event->type])
+	    ||(w->event_callbacks[event->type])))
+    {
+      if(w->event_callbacks["_"+event->type])
+	w->event_callbacks["_"+event->type](event,this_object());
+      if(w->event_callbacks[event->type])
+	w->event_callbacks[event->type](event,this_object());
+    }
     else
       if (misc_event_handler)
-	misc_event_handler(event);
+	misc_event_handler(event,this_object());
       else
 	werror(sprintf("Ignored event %s\n", event->type));
   }
   
   mapping reply;  /* Partially read reply or event */
 
+  void get_keyboard_mapping();
+
   array process()
   {
     string msg;
@@ -348,6 +358,7 @@ class Display
 	      werror("Xlib.Display->process: screen_number too large.\n");
 	    state = STATE_WAIT_HEADER;
 	    received->expect(32);
+	    get_keyboard_mapping();
 	    return ({ ACTION_CONNECT });
 	  }
 	case STATE_WAIT_HEADER:
@@ -387,18 +398,18 @@ class Display
 		  case "ButtonRelease":
 		  case "MotionNotify": {
 		    int root, child;
-		    sscanf(msg, "%*c%c%2c%4c" "%4c%4c%4c" "%2c%2c%2c%2c" "%2c%c",
+		    sscanf(msg, "%*c%c%2c%4c" "%4c%4c%4c"
+			        "%2c%2c%2c%2c" "%2c%c",
 			   event->detail, event->sequenceNumber, event->time,
 			   root, event->wid, child,
-			   event->rootX, event->rootY, event->eventx, event->eventY,
-			   event->state, event->sameScreen);
+			   event->rootX, event->rootY, event->eventx, 
+			   event->eventY, event->state, event->sameScreen);
 		    event->root = lookup_id(root);
 		    event->event = lookup_id(event->wid);
 		    event->child = child && lookup_id(child);
 		    break;
 		  }
-#if 0 
-		
+#if 0
 		  case "EnterNotify":
 		  case "LeaveNotify":
 		    ...;
@@ -493,11 +504,17 @@ class Display
 		    ...;
 		  case "ClientMessage":
 		    ...;
-		  case "MappingNotify":
 #endif		
+		  case "MappingNotify":
+		    get_keyboard_mapping();
+		    event = ([ "type" : "MappingNotify",
+			       "raw" : msg ]);
+		    break;
+
 		  default:  /* Any other event */
-		    event = ([ "type" : "Unimplemented",
-			     "name" : type,
+		    werror("Unimplemented event: "+
+			   _Xlib.event_types[msg[0] & 0x3f]+"\n");
+		    event = ([ "type" :type,
 			     "raw" : msg ]);
 		    break;
 		  }
@@ -536,8 +553,10 @@ class Display
 	      m_delete(pending_requests, a[1]->sequenceNumber);
 	      handler->handle_reply(1, a[1]);
 	    }
-	  else
+	  else if(reply_handler)
 	    reply_handler(this_object(), a[1]);
+	  else
+	    werror("Unhandled reply: "+a[1]->sequenceNumber+"\n");
 	  break;
 	}
       case ACTION_ERROR:
@@ -600,14 +619,13 @@ class Display
 
     string host = strlen(fields[0]) ? fields[0] : "localhost";
 
-    if (async)
-      { /* Asynchronous connection */
-	open_socket();
-	set_nonblocking(0, 0, close_callback);
-      }
-    if (!connect(host, XPORT + (int) fields[1]))
+    if (!connect(host, XPORT + (int)fields[1]))
       return 0;
 
+    /* Asynchronous connection */
+    if (async)
+      set_nonblocking(0, 0, close_callback);
+
     screen_number = (int) fields[2];
     
     buffer = "";
@@ -639,9 +657,11 @@ class Display
 	switch(a[0])
 	  {
 	  case ACTION_CONNECT:
+	    get_keyboard_mapping();
 	    set_nonblocking(read_callback, 0, close_callback);
 	    return 1;
 	  case ACTION_CONNECT_FAILED:
+	    werror("Connection failed: "+a[1]+"\n");
 	    return 0;
 	  default:
 	    error("Xlib.Display->open: Internal error!\n");
@@ -677,14 +697,14 @@ class Display
 	      if ((a[0] == ACTION_REPLY)
 		  && (a[1]->sequenceNumber == n))
 		{
-		  result = req->handle_reply(a[1]);
+		  result = req->handle_reply(1,a[1]);
 		  done = 1;
 		  break;
 		}
 	      else if ((a[0] == ACTION_ERROR)
 		       && (a[1]->sequenceNumber == n))
 		{
-		  result = req->handle_error(a[1]);
+		  result = req->handle_error(1,a[1]);
 		  done = 1;
 		  break;
 		}
@@ -707,7 +727,20 @@ class Display
   void send_async_request(object req, function callback)
   {
     int n = send_request(req);
-    pending_requests[n] == async_request(req, callback);
+    pending_requests[n] = async_request(req, callback);
+  }
+
+  void got_mapping(int ok, array foo)
+  {
+    key_mapping = foo;
+  }
+
+  void get_keyboard_mapping()
+  {
+    object r = Requests.GetKeyboardMapping();
+    r->first = minKeyCode;
+    r->num = maxKeyCode - minKeyCode + 1;
+    send_async_request(r, got_mapping);
   }
 
   object DefaultRootWindow()
diff --git a/lib/modules/Protocols.pmod/X.pmod/db/compose b/lib/modules/Protocols.pmod/X.pmod/db/compose
new file mode 100644
index 0000000000000000000000000000000000000000..46ce7e2307d1c1b47ce3f085534d19f0028d2754
--- /dev/null
+++ b/lib/modules/Protocols.pmod/X.pmod/db/compose
@@ -0,0 +1,480 @@
+Multi_key plus plus		: numbersign
+Multi_key apostrophe space	: apostrophe
+Multi_key space apostrophe	: apostrophe
+Multi_key A A			: at
+Multi_key parenleft parenleft	: bracketleft
+Multi_key slash slash		: backslash
+Multi_key slash less		: backslash
+Multi_key less slash		: backslash
+Multi_key parenright parenright	: bracketright
+Multi_key asciicircum space	: asciicircum
+Multi_key space asciicircum	: asciicircum
+Multi_key greater space		: asciicirum
+Multi_key space greater		: asciicirum
+Multi_key grave space		: grave
+Multi_key space grave		: grave
+Multi_key parenleft minus	: braceleft
+Multi_key minus parenleft	: braceleft
+Multi_key slash asciicircum	: bar
+Multi_key asciicircum slash	: bar
+Multi_key V L			: bar
+Multi_key L V			: bar
+Multi_key v l			: bar
+Multi_key l v			: bar
+Multi_key parenright minus	: braceright
+Multi_key minus parenright	: braceright
+Multi_key asciitilde space	: asciitilde
+Multi_key space asciitilde	: asciitilde
+Multi_key minus space		: asciitilde
+Multi_key space minus		: asciitilde
+Multi_key exclam exclam		: exclamdown
+Multi_key c slash		: cent
+Multi_key slash c		: cent
+Multi_key C slash		: cent
+Multi_key slash C		: cent
+Multi_key C bar			: cent
+Multi_key bar C			: cent
+Multi_key c bar			: cent
+Multi_key bar c			: cent
+Multi_key l minus		: sterling
+Multi_key minus l		: sterling
+Multi_key L minus		: sterling
+Multi_key minus L		: sterling
+Multi_key l equal		: sterling
+Multi_key equal l		: sterling
+Multi_key L equal		: sterling
+Multi_key equal L		: sterling
+Multi_key y minus		: yen
+Multi_key minus y		: yen
+Multi_key Y minus		: yen
+Multi_key minus Y		: yen
+Multi_key y equal		: yen
+Multi_key equal y		: yen
+Multi_key Y equal		: yen
+Multi_key equal Y		: yen
+Multi_key s o			: section
+Multi_key o s			: section
+Multi_key S O			: section
+Multi_key O S			: section
+Multi_key S exclam		: section
+Multi_key exclam S		: section
+Multi_key s exclam		: section
+Multi_key exclam s		: section
+Multi_key S 0			: section
+Multi_key 0 S			: section
+Multi_key s 0			: section
+Multi_key 0 s			: section
+Multi_key x o			: currency
+Multi_key o x			: currency
+Multi_key X O			: currency
+Multi_key O X			: currency
+Multi_key x O			: currency
+Multi_key O x			: currency
+Multi_key X o			: currency
+Multi_key o X			: currency
+Multi_key x 0			: currency
+Multi_key 0 x			: currency
+Multi_key X 0			: currency
+Multi_key 0 X			: currency
+Multi_key c o			: copyright
+Multi_key o c			: copyright
+Multi_key C O			: copyright
+Multi_key O C			: copyright
+Multi_key c O			: copyright
+Multi_key O c			: copyright
+Multi_key C o			: copyright
+Multi_key o C			: copyright
+Multi_key c 0			: copyright
+Multi_key 0 c			: copyright
+Multi_key C 0			: copyright
+Multi_key 0 C			: copyright
+Multi_key a underscore		: ordfeminine
+Multi_key underscore a		: ordfeminine
+Multi_key A underscore		: ordfeminine
+Multi_key underscore A		: ordfeminine
+Multi_key o underscore		: masculine
+Multi_key underscore o		: masculine
+Multi_key O underscore		: masculine
+Multi_key underscore O		: masculine
+Multi_key less less		: guillemotleft
+Multi_key greater greater	: guillemotright
+Multi_key 0 asciicircum		: degree
+Multi_key asciicircum 0		: degree
+Multi_key 0 asterisk		: degree
+Multi_key asterisk 0		: degree
+Multi_key plus minus		: plusminus
+Multi_key minus plus		: plusminus
+Multi_key slash u		: mu
+Multi_key u slash		: mu
+Multi_key slash U		: mu
+Multi_key U slash		: mu
+Multi_key 1 asciicircum		: onesuperior
+Multi_key asciicircum 1		: onesuperior
+Multi_key S 1			: onesuperior
+Multi_key 1 S			: onesuperior
+Multi_key s 1			: onesuperior
+Multi_key 1 s			: onesuperior
+Multi_key 2 asciicircum		: twosuperior
+Multi_key asciicircum 2		: twosuperior
+Multi_key S 2			: twosuperior
+Multi_key 2 S			: twosuperior
+Multi_key s 2			: twosuperior
+Multi_key 2 s			: twosuperior
+Multi_key 3 asciicircum		: threesuperior
+Multi_key asciicircum 3		: threesuperior
+Multi_key S 3			: threesuperior
+Multi_key 3 S			: threesuperior
+Multi_key s 3			: threesuperior
+Multi_key 3 s			: threesuperior
+Multi_key p exclam		: paragraph
+Multi_key exclam p		: paragraph
+Multi_key P exclam		: paragraph
+Multi_key exclam P		: paragraph
+Multi_key period asciicircum	: periodcentered
+Multi_key asciicircum period	: periodcentered
+Multi_key period period		: periodcentered
+Multi_key 1 4			: onequarter
+Multi_key 1 2			: onehalf
+Multi_key 3 4			: threequarters
+Multi_key question question	: questiondown
+Multi_key space space		: nobreakspace
+Multi_key bar bar		: brokenbar
+Multi_key exclam asciicircum	: brokenbar
+Multi_key asciicircum exclam	: brokenbar
+Multi_key V B			: brokenbar
+Multi_key B V			: brokenbar
+Multi_key v b			: brokenbar
+Multi_key b v			: brokenbar
+Multi_key minus comma		: notsign
+Multi_key comma minus		: notsign
+Multi_key minus minus		: hyphen
+Multi_key R O			: registered
+Multi_key O R			: registered
+Multi_key minus asciicircum	: macron
+Multi_key asciicircum minus	: macron
+Multi_key underscore asciicircum: macron
+Multi_key asciicircum underscore: macron
+Multi_key underscore underscore	: macron
+Multi_key minus colon		: division
+Multi_key colon minus		: division
+Multi_key x x			: multiply
+Multi_key apostrophe apostrophe	: acute
+Multi_key comma comma		: cedilla
+Multi_key quotedbl quotedbl	: diaeresis
+Multi_key A grave		: Agrave
+Multi_key grave A		: Agrave
+Multi_key A acute		: Aacute
+Multi_key acute A		: Aacute
+Multi_key A apostrophe		: Aacute
+Multi_key apostrophe A		: Aacute
+Multi_key A asciicircum		: Acircumflex
+Multi_key asciicircum A		: Acircumflex
+Multi_key A greater		: Acircumflex
+Multi_key greater A		: Acircumflex
+Multi_key A asciitilde		: Atilde
+Multi_key asciitilde A		: Atilde
+Multi_key A minus		: Atilde
+Multi_key minus A		: Atilde
+Multi_key A quotedbl		: Adiaeresis
+Multi_key quotedbl A		: Adiaeresis
+Multi_key A asterisk		: Aring
+Multi_key asterisk A		: Aring
+Multi_key A E			: AE
+Multi_key a grave		: agrave
+Multi_key grave a		: agrave
+Multi_key a acute		: aacute
+Multi_key acute a		: aacute
+Multi_key a apostrophe		: aacute
+Multi_key apostrophe a		: aacute
+Multi_key a asciicircum		: acircumflex
+Multi_key asciicircum a		: acircumflex
+Multi_key a greater		: acircumflex
+Multi_key greater a		: acircumflex
+Multi_key a asciitilde		: atilde
+Multi_key asciitilde a		: atilde
+Multi_key a minus		: atilde
+Multi_key minus a		: atilde
+Multi_key a quotedbl		: adiaeresis
+Multi_key quotedbl a		: adiaeresis
+Multi_key a asterisk		: aring
+Multi_key asterisk a		: aring
+Multi_key a e			: ae
+Multi_key C comma		: Ccedilla
+Multi_key comma C		: Ccedilla
+Multi_key c comma		: ccedilla
+Multi_key comma c		: ccedilla
+Multi_key minus D		: ETH
+Multi_key D minus		: ETH
+Multi_key minus d		: eth
+Multi_key d minus		: eth
+Multi_key E grave		: Egrave
+Multi_key grave E		: Egrave
+Multi_key E acute		: Eacute
+Multi_key acute E		: Eacute
+Multi_key E apostrophe		: Eacute
+Multi_key apostrophe E		: Eacute
+Multi_key E asciicircum		: Ecircumflex
+Multi_key asciicircum E		: Ecircumflex
+Multi_key E greater		: Ecircumflex
+Multi_key greater E		: Ecircumflex
+Multi_key E quotedbl		: Ediaeresis
+Multi_key quotedbl E		: Ediaeresis
+Multi_key e grave		: egrave
+Multi_key grave e		: egrave
+Multi_key e acute		: eacute
+Multi_key acute e		: eacute
+Multi_key e apostrophe		: eacute
+Multi_key apostrophe e		: eacute
+Multi_key e asciicircum		: ecircumflex
+Multi_key asciicircum e		: ecircumflex
+Multi_key e greater		: ecircumflex
+Multi_key greater e		: ecircumflex
+Multi_key e quotedbl		: ediaeresis
+Multi_key quotedbl e		: ediaeresis
+Multi_key I grave		: Igrave
+Multi_key grave I		: Igrave
+Multi_key I acute		: Iacute
+Multi_key acute I		: Iacute
+Multi_key I apostrophe		: Iacute
+Multi_key apostrophe I		: Iacute
+Multi_key I asciicircum		: Icircumflex
+Multi_key asciicircum I		: Icircumflex
+Multi_key I greater		: Icircumflex
+Multi_key greater I		: Icircumflex
+Multi_key I quotedbl		: Idiaeresis
+Multi_key quotedbl I		: Idiaeresis
+Multi_key i grave		: igrave
+Multi_key grave i		: igrave
+Multi_key i acute		: iacute
+Multi_key acute i		: iacute
+Multi_key i apostrophe		: iacute
+Multi_key apostrophe i		: iacute
+Multi_key i asciicircum		: icircumflex
+Multi_key asciicircum i		: icircumflex
+Multi_key i greater		: icircumflex
+Multi_key greater i		: icircumflex
+Multi_key i quotedbl		: idiaeresis
+Multi_key quotedbl i		: idiaeresis
+Multi_key N asciitilde		: Ntilde
+Multi_key asciitilde N		: Ntilde
+Multi_key N minus		: Ntilde
+Multi_key minus N		: Ntilde
+Multi_key n asciitilde		: ntilde
+Multi_key asciitilde n		: ntilde
+Multi_key n minus		: ntilde
+Multi_key minus n		: ntilde
+Multi_key O grave		: Ograve
+Multi_key grave O		: Ograve
+Multi_key O acute		: Oacute
+Multi_key acute O		: Oacute
+Multi_key O apostrophe		: Oacute
+Multi_key apostrophe O		: Oacute
+Multi_key O asciicircum		: Ocircumflex
+Multi_key asciicircum O		: Ocircumflex
+Multi_key O greater		: Ocircumflex
+Multi_key greater O		: Ocircumflex
+Multi_key O asciitilde		: Otilde
+Multi_key asciitilde O		: Otilde
+Multi_key O minus		: Otilde
+Multi_key minus O		: Otilde
+Multi_key O quotedbl		: Odiaeresis
+Multi_key quotedbl O		: Odiaeresis
+Multi_key O slash		: Ooblique
+Multi_key slash O		: Ooblique
+Multi_key o grave		: ograve
+Multi_key grave o		: ograve
+Multi_key o acute		: oacute
+Multi_key acute o		: oacute
+Multi_key o apostrophe		: oacute
+Multi_key apostrophe o		: oacute
+Multi_key o asciicircum		: ocircumflex
+Multi_key asciicircum o		: ocircumflex
+Multi_key o greater		: ocircumflex
+Multi_key greater o		: ocircumflex
+Multi_key o asciitilde		: otilde
+Multi_key asciitilde o		: otilde
+Multi_key o minus		: otilde
+Multi_key minus o		: otilde
+Multi_key o quotedbl		: odiaeresis
+Multi_key quotedbl o		: odiaeresis
+Multi_key o slash		: oslash
+Multi_key slash o		: oslash
+Multi_key U grave		: Ugrave
+Multi_key grave U		: Ugrave
+Multi_key U acute		: Uacute
+Multi_key acute U		: Uacute
+Multi_key U apostrophe		: Uacute
+Multi_key apostrophe U		: Uacute
+Multi_key U asciicircum		: Ucircumflex
+Multi_key asciicircum U		: Ucircumflex
+Multi_key U greater		: Ucircumflex
+Multi_key greater U		: Ucircumflex
+Multi_key U quotedbl		: Udiaeresis
+Multi_key quotedbl U		: Udiaeresis
+Multi_key u grave		: ugrave
+Multi_key grave u		: ugrave
+Multi_key u acute		: uacute
+Multi_key acute u		: uacute
+Multi_key u apostrophe		: uacute
+Multi_key apostrophe u		: uacute
+Multi_key u asciicircum		: ucircumflex
+Multi_key asciicircum u		: ucircumflex
+Multi_key u greater		: ucircumflex
+Multi_key greater u		: ucircumflex
+Multi_key u quotedbl		: udiaeresis
+Multi_key quotedbl u		: udiaeresis
+Multi_key s s			: ssharp
+Multi_key T H			: THORN
+Multi_key t h			: thorn
+Multi_key Y acute		: Yacute
+Multi_key acute Y		: Yacute
+Multi_key Y apostrophe		: Yacute
+Multi_key apostrophe Y		: Yacute
+Multi_key y acute		: yacute
+Multi_key acute y		: yacute
+Multi_key y apostrophe		: yacute
+Multi_key apostrophe y		: yacute
+Multi_key y quotedbl		: ydiaeresis
+Multi_key quotedbl y		: ydiaeresis
+dead_circumflex  slash		: bar
+dead_grave space		: grave
+dead_acute space		: apostrophe
+dead_diaeresis space		: diaeresis
+dead_circumflex space		: asciicircum
+dead_tilde space		: asciitilde
+dead_grave space		: grave
+dead_acute space		: apostrophe
+dead_circumflex 0		: degree
+dead_circumflex 1		: onesuperior
+dead_circumflex 2		: twosuperior
+dead_circumflex 3		: threesuperior
+dead_circumflex period		: periodcentered
+dead_circumflex exclam		: brokenbar
+dead_cedilla minus		: notsign
+dead_circumflex minus		: macron
+dead_circumflex underscore	: macron
+dead_acute apostrophe		: acute
+dead_cedilla comma		: cedilla
+dead_diaeresis quotedbl		: diaeresis
+dead_grave A			: Agrave
+dead_acute A			: Aacute
+dead_circumflex A		: Acircumflex
+dead_tilde A			: Atilde
+dead_diaeresis A		: Adiaeresis
+dead_grave a			: agrave
+dead_acute a			: aacute
+dead_circumflex a		: acircumflex
+dead_tilde a			: atilde
+dead_diaeresis a		: adiaeresis
+dead_cedilla C			: Ccedilla
+dead_cedilla c			: ccedilla
+dead_grave E			: Egrave
+dead_acute E			: Eacute
+dead_circumflex E		: Ecircumflex
+dead_diaeresis E		: Ediaeresis
+dead_grave e			: egrave
+dead_acute e			: eacute
+dead_circumflex e		: ecircumflex
+dead_diaeresis e		: ediaeresis
+dead_grave I			: Igrave
+dead_acute I			: Iacute
+dead_circumflex I		: Icircumflex
+dead_diaeresis I		: Idiaeresis
+dead_grave i			: igrave
+dead_acute i			: iacute
+dead_circumflex i		: icircumflex
+dead_diaeresis i		: idiaeresis
+dead_tilde N			: Ntilde
+dead_tilde n			: ntilde
+dead_grave O			: Ograve
+dead_acute O			: Oacute
+dead_circumflex O		: Ocircumflex
+dead_tilde O			: Otilde
+dead_diaeresis O		: Odiaeresis
+dead_grave o			: ograve
+dead_acute o			: oacute
+dead_circumflex o		: ocircumflex
+dead_tilde o			: otilde
+dead_diaeresis o		: odiaeresis
+dead_grave U			: Ugrave
+dead_acute U			: Uacute
+dead_circumflex U		: Ucircumflex
+dead_diaeresis U		: Udiaeresis
+dead_grave u			: ugrave
+dead_acute u			: uacute
+dead_circumflex u		: ucircumflex
+dead_diaeresis u		: udiaeresis
+dead_acute Y			: Yacute
+dead_acute y			: yacute
+dead_diaeresis y		: ydiaeresis
+SunFA_Circum  slash		: bar
+SunFA_Grave space		: grave
+SunFA_Acute space		: apostrophe
+SunFA_Diaeresis space		: diaeresis
+SunFA_Circum space		: asciicircum
+SunFA_tilde space		: tilde
+SunFA_Grave space		: grave
+SunFA_Acute space		: apostrophe
+SunFA_Circum 0			: degree
+SunFA_Circum 1			: onesuperior
+SunFA_Circum 2			: twosuperior
+SunFA_Circum 3			: threesuperior
+SunFA_Circum period		: periodcentered
+SunFA_Circum exclam		: brokenbar
+SunFA_cedilla minus		: notsign
+SunFA_Circum minus		: macron
+SunFA_Circum underscore		: macron
+SunFA_Acute apostrophe		: acute
+SunFA_cedilla comma		: cedilla
+SunFA_Diaeresis quotedbl	: diaeresis
+SunFA_Grave A			: Agrave
+SunFA_Acute A			: Aacute
+SunFA_Circum A			: Acircumflex
+SunFA_tilde A			: Atilde
+SunFA_Diaeresis A		: Adiaeresis
+SunFA_Grave a			: agrave
+SunFA_Acute a			: aacute
+SunFA_Circum a			: acircumflex
+SunFA_tilde a			: atilde
+SunFA_Diaeresis a		: adiaeresis
+SunFA_cedilla C			: Ccedilla
+SunFA_cedilla c			: ccedilla
+SunFA_Grave E			: Egrave
+SunFA_Acute E			: Eacute
+SunFA_Circum E			: Ecircumflex
+SunFA_Diaeresis E		: Ediaeresis
+SunFA_Grave e			: egrave
+SunFA_Acute e			: eacute
+SunFA_Circum e			: ecircumflex
+SunFA_Diaeresis e		: ediaeresis
+SunFA_Grave I			: Igrave
+SunFA_Acute I			: Iacute
+SunFA_Circum I			: Icircumflex
+SunFA_Diaeresis I		: Idiaeresis
+SunFA_Grave i			: igrave
+SunFA_Acute i			: iacute
+SunFA_Circum i			: icircumflex
+SunFA_Diaeresis i		: idiaeresis
+SunFA_tilde N			: Ntilde
+SunFA_tilde n			: ntilde
+SunFA_Grave O			: Ograve
+SunFA_Acute O			: Oacute
+SunFA_Circum O			: Ocircumflex
+SunFA_tilde O			: Otilde
+SunFA_Diaeresis O		: Odiaeresis
+SunFA_Grave o			: ograve
+SunFA_Acute o			: oacute
+SunFA_Circum o			: ocircumflex
+SunFA_tilde o			: otilde
+SunFA_Diaeresis o		: odiaeresis
+SunFA_Grave U			: Ugrave
+SunFA_Acute U			: Uacute
+SunFA_Circum U			: Ucircumflex
+SunFA_Diaeresis U		: Udiaeresis
+SunFA_Grave u			: ugrave
+SunFA_Acute u			: uacute
+SunFA_Circum u			: ucircumflex
+SunFA_Diaeresis u		: udiaeresis
+SunFA_Acute Y			: Yacute
+SunFA_Acute y			: yacute
+SunFA_Diaeresis y		: ydiaeresis
diff --git a/lib/modules/Protocols.pmod/X.pmod/db/compose.db b/lib/modules/Protocols.pmod/X.pmod/db/compose.db
new file mode 100644
index 0000000000000000000000000000000000000000..3b2f018e6ab6c55dfb7084a28ac6aad1d7b413d9
Binary files /dev/null and b/lib/modules/Protocols.pmod/X.pmod/db/compose.db differ
diff --git a/lib/modules/Protocols.pmod/X.pmod/db/convert_compose.pike b/lib/modules/Protocols.pmod/X.pmod/db/convert_compose.pike
new file mode 100644
index 0000000000000000000000000000000000000000..1a64806d9a2b0f574f4d72009bfa488c269ab177
--- /dev/null
+++ b/lib/modules/Protocols.pmod/X.pmod/db/convert_compose.pike
@@ -0,0 +1,44 @@
+
+void main()
+{
+  string a, b;
+  mixed from, to;
+  mapping repl=([]);
+  foreach(Stdio.read_bytes("keysyms")/"\n", string line)
+    if(sscanf(replace(line,"\t", " ")-" ", "%s:%s", a, b)==2)
+      repl[a]=("0x"+b);
+
+  mapping patterns = ([]);
+
+  foreach(Stdio.read_bytes("compose")/"\n", 
+	  string line)
+  {
+    if(sscanf(line, "%s:%s", from, to)==2)
+    {
+      from = replace(from,"\t"," ")/" "-({""});
+      for(int i=0;i<sizeof(from); i++)
+      {
+	from[i] -= " ";
+	from[i] -= " ";
+	if(!repl[from[i]])
+	  werror("Unknown keysym: '"+from[i]+"'\n");
+	from[i] = repl[from[i]];
+      }
+      to -= " ";
+      if(!repl[to])
+	werror("Unknown keysym: '"+to+"'\n");
+      to = repl[to];
+      string p = "";
+      int res = (int)to;
+      for(int i=0;i<sizeof(from)-1; i++)
+      {
+	p+=sprintf("%4c", (int)from[i]);
+	patterns[p]=({}); // continue..
+      }
+      p+=sprintf("%4c", (int)from[i]);
+      patterns[p]=res;
+    }
+  }
+  werror("Have "+sizeof(patterns)+" compose rules\n");
+  write(encode_value(patterns));
+}
diff --git a/lib/modules/Protocols.pmod/X.pmod/db/keysyms b/lib/modules/Protocols.pmod/X.pmod/db/keysyms
new file mode 100644
index 0000000000000000000000000000000000000000..a857a559ebbfc16162f84aefbe4cfff213c41cd4
--- /dev/null
+++ b/lib/modules/Protocols.pmod/X.pmod/db/keysyms
@@ -0,0 +1,393 @@
+hpmute_acute		:100000A8
+hpmute_grave		:100000A9
+hpmute_asciicircum	:100000AA
+hpmute_diaeresis	:100000AB
+hpmute_asciitilde	:100000AC
+hplira			:100000AF
+hpguilder		:100000BE
+hpYdiaeresis		:100000EE
+hpIO			:100000EE
+hplongminus		:100000F6
+hpblock			:100000FC
+apLineDel		:1000FF00
+apCharDel		:1000FF01
+apCopy			:1000FF02
+apCut			:1000FF03
+apPaste			:1000FF04
+apMove			:1000FF05
+apGrow			:1000FF06
+apCmd			:1000FF07
+apShell			:1000FF08
+apLeftBar		:1000FF09
+apRightBar		:1000FF0A
+apLeftBox		:1000FF0B
+apRightBox		:1000FF0C
+apUpBox			:1000FF0D
+apDownBox		:1000FF0E
+apPop			:1000FF0F
+apRead			:1000FF10
+apEdit			:1000FF11
+apSave			:1000FF12
+apExit			:1000FF13
+apRepeat		:1000FF14
+hpModelock1		:1000FF48
+hpModelock2		:1000FF49
+hpReset			:1000FF6C
+hpSystem		:1000FF6D
+hpUser			:1000FF6E
+hpClearLine		:1000FF6F
+hpInsertLine		:1000FF70
+hpDeleteLine		:1000FF71
+hpInsertChar		:1000FF72
+hpDeleteChar		:1000FF73
+hpBackTab		:1000FF74
+hpKP_BackTab		:1000FF75
+apKP_parenleft		:1000FFA8
+apKP_parenright		:1000FFA9
+
+I2ND_FUNC_L		:10004001
+I2ND_FUNC_R		:10004002
+IREMOVE			:10004003
+IREPEAT			:10004004
+IA1			:10004101
+IA2			:10004102
+IA3			:10004103
+IA4			:10004104
+IA5			:10004105
+IA6			:10004106
+IA7			:10004107
+IA8			:10004108
+IA9			:10004109
+IA10			:1000410A
+IA11			:1000410B
+IA12			:1000410C
+IA13			:1000410D
+IA14			:1000410E
+IA15			:1000410F
+IB1			:10004201
+IB2			:10004202
+IB3			:10004203
+IB4			:10004204
+IB5			:10004205
+IB6			:10004206
+IB7			:10004207
+IB8			:10004208
+IB9			:10004209
+IB10			:1000420A
+IB11			:1000420B
+IB12			:1000420C
+IB13			:1000420D
+IB14			:1000420E
+IB15			:1000420F
+IB16			:10004210
+
+DRemove			:1000FF00
+Dring_accent		:1000FEB0
+Dcircumflex_accent	:1000FE5E
+dead_circumflex		:1000FE5E
+Dcedilla_accent		:1000FE2C
+Dacute_accent		:1000FE27
+Dgrave_accent		:1000FE60
+Dtilde			:1000FE7E
+dead_tilde		:1000FE7E
+Ddiaeresis		:1000FE22
+
+osfCopy			:1004FF02
+osfCut			:1004FF03
+osfPaste		:1004FF04
+osfBackTab		:1004FF07
+osfBackSpace		:1004FF08
+osfClear		:1004FF0B
+osfEscape		:1004FF1B
+osfAddMode		:1004FF31
+osfPrimaryPaste		:1004FF32
+osfQuickPaste		:1004FF33
+osfPageLeft		:1004FF40
+osfPageUp		:1004FF41
+osfPageDown		:1004FF42
+osfPageRight		:1004FF43
+osfActivate		:1004FF44
+osfMenuBar		:1004FF45
+osfLeft			:1004FF51
+osfUp			:1004FF52
+osfRight		:1004FF53
+osfDown			:1004FF54
+osfPrior		:1004FF55
+osfNext			:1004FF56
+osfEndLine		:1004FF57
+osfBeginLine		:1004FF58
+osfEndData		:1004FF59
+osfBeginData		:1004FF5A
+osfPrevMenu		:1004FF5B
+osfNextMenu		:1004FF5C
+osfPrevField		:1004FF5D
+osfNextField		:1004FF5E
+osfSelect		:1004FF60
+osfInsert		:1004FF63
+osfUndo			:1004FF65
+osfMenu			:1004FF67
+osfCancel		:1004FF69
+osfHelp			:1004FF6A
+osfSelectAll		:1004FF71
+osfDeselectAll		:1004FF72
+osfReselect		:1004FF73
+osfExtend		:1004FF74
+osfRestore		:1004FF78
+osfSwitchDirection	:1004FF7E
+osfPriorMinor		:1004FFF5
+osfNextMinor		:1004FFF6
+osfRightLine		:1004FFF7
+osfLeftLine		:1004FFF8
+osfDelete		:1004FFFF
+
+SunFA_Grave		:1005FF00
+SunFA_grave		:1005FF00
+SunFA_Circum		:1005FF01
+SunFA_circum		:1005FF01
+SunFA_Tilde		:1005FF02
+SunFA_tilde		:1005FF02
+SunFA_Acute		:1005FF03
+SunFA_acute		:1005FF03
+SunFA_Diaeresis		:1005FF04
+SunFA_diaeresis		:1005FF04
+SunFA_Cedilla		:1005FF05
+SunFA_cedilla		:1005FF05
+SunF36			:1005FF10
+SunF37			:1005FF11
+SunSys_Req		:1005FF60
+SunProps		:1005FF70
+SunFront		:1005FF71
+SunCopy			:1005FF72
+SunOpen			:1005FF73
+SunPaste		:1005FF74
+SunCut			:1005FF75
+SunPowerSwitch		:1005FF76
+SunAudioLowerVolume	:1005FF77
+SunAudioMute		:1005FF78
+SunAudioRaiseVolume	:1005FF79
+SunVideoDegauss		:1005FF7A
+SunVideoLowerBrightness	:1005FF7B
+SunVideoRaiseBrightness	:1005FF7C
+SunPowerSwitchShift	:1005FF7D
+SunCompose		:FF20
+SunPageUp		:FF55
+SunPageDown		:FF56
+SunPrint_Screen		:FF61
+SunUndo			:FF65
+SunAgain		:FF66
+SunFind			:FF68
+SunStop			:FF69
+SunAltGraph		:FF7E
+WYSetup			:1006FF00
+ncdSetup		:1006FF00
+XeroxPointerButton1	:10070001
+XeroxPointerButton2	:10070002
+XeroxPointerButton3	:10070003
+XeroxPointerButton4	:10070004
+XeroxPointerButton5	:10070005
+XF86ModeLock		:1008FF01
+dead_acute		:100000A8
+dead_grave		:100000A9
+dead_diaeresis		:100000AB
+dead_asciicircum	:100000AA
+dead_asciitilde		:100000AC
+dead_cedilla		:1000FE2C
+dead_ring		:1000FEB0
+space               :20
+exclam              :21
+quotedbl            :22
+numbersign          :23
+dollar              :24
+percent             :25
+ampersand           :26
+apostrophe          :27
+quoteright          :27
+parenleft           :28
+parenright          :29
+asterisk            :2a
+plus                :2b
+comma               :2c
+minus               :2d
+period              :2e
+slash               :2f
+0                   :30
+1                   :31
+2                   :32
+3                   :33
+4                   :34
+5                   :35
+6                   :36
+7                   :37
+8                   :38
+9                   :39
+colon               :3a
+semicolon           :3b
+less                :3c
+equal               :3d
+greater             :3e
+question            :3f
+at                  :40
+A                   :41
+B                   :42
+C                   :43
+D                   :44
+E                   :45
+F                   :46
+G                   :47
+H                   :48
+I                   :49
+J                   :4a
+K                   :4b
+L                   :4c
+M                   :4d
+N                   :4e
+O                   :4f
+P                   :50
+Q                   :51
+R                   :52
+S                   :53
+T                   :54
+U                   :55
+V                   :56
+W                   :57
+X                   :58
+Y                   :59
+Z                   :5a
+bracketleft         :5b
+backslash           :5c
+bracketright        :5d
+asciicircum         :5e
+asciicirum          :5e
+underscore          :5f
+grave               :60
+quoteleft           :60
+a                   :61
+b                   :62
+c                   :63
+d                   :64
+e                   :65
+f                   :66
+g                   :67
+h                   :68
+i                   :69
+j                   :6a
+k                   :6b
+l                   :6c
+m                   :6d
+n                   :6e
+o                   :6f
+p                   :70
+q                   :71
+r                   :72
+s                   :73
+t                   :74
+u                   :75
+v                   :76
+w                   :77
+x                   :78
+y                   :79
+z                   :7a
+braceleft           :7b
+bar                 :7c
+braceright          :7d
+asciitilde          :7e
+tilde          :7e
+nobreakspace        :a0
+exclamdown          :a1
+cent        	    :a2
+sterling            :a3
+currency            :a4
+yen                 :a5
+brokenbar           :a6
+section             :a7
+diaeresis           :a8
+copyright           :a9
+ordfeminine         :aa
+guillemotleft       :ab
+notsign             :ac
+hyphen              :ad
+registered          :ae
+macron              :af
+degree              :b0
+plusminus           :b1
+twosuperior         :b2
+threesuperior       :b3
+acute               :b4
+mu                  :b5
+paragraph           :b6
+periodcentered      :b7
+cedilla             :b8
+onesuperior         :b9
+masculine           :ba
+guillemotright      :bb
+onequarter          :bc
+onehalf             :bd
+threequarters       :be
+questiondown        :bf
+Agrave              :c0
+Aacute              :c1
+Acircumflex         :c2
+Atilde              :c3
+Adiaeresis          :c4
+Aring               :c5
+AE                  :c6
+Ccedilla            :c7
+Egrave              :c8
+Eacute              :c9
+Ecircumflex         :ca
+Ediaeresis          :cb
+Igrave              :cc
+Iacute              :cd
+Icircumflex         :ce
+Idiaeresis          :cf
+ETH                 :d0
+Eth                 :d0
+Ntilde              :d1
+Ograve              :d2
+Oacute              :d3
+Ocircumflex         :d4
+Otilde              :d5
+Odiaeresis          :d6
+multiply            :d7
+Ooblique            :d8
+Ugrave              :d9
+Uacute              :da
+Ucircumflex         :db
+Udiaeresis          :dc
+Yacute              :dd
+THORN               :de
+Thorn               :de
+ssharp              :df
+agrave              :e0
+aacute              :e1
+acircumflex         :e2
+atilde              :e3
+adiaeresis          :e4
+aring               :e5
+ae                  :e6
+ccedilla            :e7
+egrave              :e8
+eacute              :e9
+ecircumflex         :ea
+ediaeresis          :eb
+igrave              :ec
+iacute              :ed
+icircumflex         :ee
+idiaeresis          :ef
+eth                 :f0
+ntilde              :f1
+ograve              :f2
+oacute              :f3
+ocircumflex         :f4
+otilde              :f5
+odiaeresis          :f6
+division            :f7
+oslash              :f8
+ugrave              :f9
+uacute              :fa
+ucircumflex         :fb
+udiaeresis          :fc
+yacute              :fd
+thorn               :fe
+ydiaeresis          :ff
+Multi_key	    :FF20
diff --git a/lib/modules/Protocols.pmod/X.pmod/keysyms.h b/lib/modules/Protocols.pmod/X.pmod/keysyms.h
new file mode 100644
index 0000000000000000000000000000000000000000..3178287265cc9ad7aa490051dcee82d1cfe1bad4
--- /dev/null
+++ b/lib/modules/Protocols.pmod/X.pmod/keysyms.h
@@ -0,0 +1,1312 @@
+#define XK_VoidSymbol		0xFFFFFF	/* void symbol */
+#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_Multi_key		0xFF20  /* Multi-key character compose */
+#define XK_Kanji		0xFF21	/* Kanji, Kanji convert */
+#define XK_Muhenkan		0xFF22  /* Cancel Conversion */
+#define XK_Henkan_Mode		0xFF23  /* Start/Stop Conversion */
+#define XK_Henkan		0xFF23  /* Alias for Henkan_Mode */
+#define XK_Romaji		0xFF24  /* to Romaji */
+#define XK_Hiragana		0xFF25  /* to Hiragana */
+#define XK_Katakana		0xFF26  /* to Katakana */
+#define XK_Hiragana_Katakana	0xFF27  /* Hiragana/Katakana toggle */
+#define XK_Zenkaku		0xFF28  /* to Zenkaku */
+#define XK_Hankaku		0xFF29  /* to Hankaku */
+#define XK_Zenkaku_Hankaku	0xFF2A  /* Zenkaku/Hankaku toggle */
+#define XK_Touroku		0xFF2B  /* Add to Dictionary */
+#define XK_Massyo		0xFF2C  /* Delete from Dictionary */
+#define XK_Kana_Lock		0xFF2D  /* Kana Lock */
+#define XK_Kana_Shift		0xFF2E  /* Kana Shift */
+#define XK_Eisu_Shift		0xFF2F  /* Alphanumeric Shift */
+#define XK_Eisu_toggle		0xFF30  /* Alphanumeric toggle */
+#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	/* Undo, oops */
+#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_KP_Space		0xFF80	/* space */
+#define XK_KP_Tab		0xFF89
+#define XK_KP_Enter		0xFF8D	/* enter */
+#define XK_KP_F1		0xFF91	/* PF1, KP_A, ... */
+#define XK_KP_F2		0xFF92
+#define XK_KP_F3		0xFF93
+#define XK_KP_F4		0xFF94
+#define XK_KP_Home		0xFF95
+#define XK_KP_Left		0xFF96
+#define XK_KP_Up		0xFF97
+#define XK_KP_Right		0xFF98
+#define XK_KP_Down		0xFF99
+#define XK_KP_Prior		0xFF9A
+#define XK_KP_Page_Up		0xFF9A
+#define XK_KP_Next		0xFF9B
+#define XK_KP_Page_Down		0xFF9B
+#define XK_KP_End		0xFF9C
+#define XK_KP_Begin		0xFF9D
+#define XK_KP_Insert		0xFF9E
+#define XK_KP_Delete		0xFF9F
+#define XK_KP_Equal		0xFFBD	/* equals */
+#define XK_KP_Multiply		0xFFAA
+#define XK_KP_Add		0xFFAB
+#define XK_KP_Separator		0xFFAC	/* separator, often comma */
+#define XK_KP_Subtract		0xFFAD
+#define XK_KP_Decimal		0xFFAE
+#define XK_KP_Divide		0xFFAF
+#define XK_KP_0			0xFFB0
+#define XK_KP_1			0xFFB1
+#define XK_KP_2			0xFFB2
+#define XK_KP_3			0xFFB3
+#define XK_KP_4			0xFFB4
+#define XK_KP_5			0xFFB5
+#define XK_KP_6			0xFFB6
+#define XK_KP_7			0xFFB7
+#define XK_KP_8			0xFFB8
+#define XK_KP_9			0xFFB9
+#define XK_F1			0xFFBE
+#define XK_F2			0xFFBF
+#define XK_F3			0xFFC0
+#define XK_F4			0xFFC1
+#define XK_F5			0xFFC2
+#define XK_F6			0xFFC3
+#define XK_F7			0xFFC4
+#define XK_F8			0xFFC5
+#define XK_F9			0xFFC6
+#define XK_F10			0xFFC7
+#define XK_F11			0xFFC8
+#define XK_L1			0xFFC8
+#define XK_F12			0xFFC9
+#define XK_L2			0xFFC9
+#define XK_F13			0xFFCA
+#define XK_L3			0xFFCA
+#define XK_F14			0xFFCB
+#define XK_L4			0xFFCB
+#define XK_F15			0xFFCC
+#define XK_L5			0xFFCC
+#define XK_F16			0xFFCD
+#define XK_L6			0xFFCD
+#define XK_F17			0xFFCE
+#define XK_L7			0xFFCE
+#define XK_F18			0xFFCF
+#define XK_L8			0xFFCF
+#define XK_F19			0xFFD0
+#define XK_L9			0xFFD0
+#define XK_F20			0xFFD1
+#define XK_L10			0xFFD1
+#define XK_F21			0xFFD2
+#define XK_R1			0xFFD2
+#define XK_F22			0xFFD3
+#define XK_R2			0xFFD3
+#define XK_F23			0xFFD4
+#define XK_R3			0xFFD4
+#define XK_F24			0xFFD5
+#define XK_R4			0xFFD5
+#define XK_F25			0xFFD6
+#define XK_R5			0xFFD6
+#define XK_F26			0xFFD7
+#define XK_R6			0xFFD7
+#define XK_F27			0xFFD8
+#define XK_R7			0xFFD8
+#define XK_F28			0xFFD9
+#define XK_R8			0xFFD9
+#define XK_F29			0xFFDA
+#define XK_R9			0xFFDA
+#define XK_F30			0xFFDB
+#define XK_R10			0xFFDB
+#define XK_F31			0xFFDC
+#define XK_R11			0xFFDC
+#define XK_F32			0xFFDD
+#define XK_R12			0xFFDD
+#define XK_F33			0xFFDE
+#define XK_R13			0xFFDE
+#define XK_F34			0xFFDF
+#define XK_R14			0xFFDF
+#define XK_F35			0xFFE0
+#define XK_R15			0xFFE0
+#define XK_Shift_L		0xFFE1	/* Left shift */
+#define XK_Shift_R		0xFFE2	/* Right shift */
+#define XK_Control_L		0xFFE3	/* Left control */
+#define XK_Control_R		0xFFE4	/* Right control */
+#define XK_Caps_Lock		0xFFE5	/* Caps lock */
+#define XK_Shift_Lock		0xFFE6	/* Shift lock */
+#define XK_Meta_L		0xFFE7	/* Left meta */
+#define XK_Meta_R		0xFFE8	/* Right meta */
+#define XK_Alt_L		0xFFE9	/* Left alt */
+#define XK_Alt_R		0xFFEA	/* Right alt */
+#define XK_Super_L		0xFFEB	/* Left super */
+#define XK_Super_R		0xFFEC	/* Right super */
+#define XK_Hyper_L		0xFFED	/* Left hyper */
+#define XK_Hyper_R		0xFFEE	/* Right hyper */
+#define	XK_ISO_Lock					0xFE01
+#define	XK_ISO_Level2_Latch				0xFE02
+#define	XK_ISO_Level3_Shift				0xFE03
+#define	XK_ISO_Level3_Latch				0xFE04
+#define	XK_ISO_Level3_Lock				0xFE05
+#define	XK_ISO_Group_Shift		0xFF7E	/* Alias for mode_switch */
+#define	XK_ISO_Group_Latch				0xFE06
+#define	XK_ISO_Group_Lock				0xFE07
+#define	XK_ISO_Next_Group				0xFE08
+#define	XK_ISO_Next_Group_Lock				0xFE09
+#define	XK_ISO_Prev_Group				0xFE0A
+#define	XK_ISO_Prev_Group_Lock				0xFE0B
+#define	XK_ISO_First_Group				0xFE0C
+#define	XK_ISO_First_Group_Lock				0xFE0D
+#define	XK_ISO_Last_Group				0xFE0E
+#define	XK_ISO_Last_Group_Lock				0xFE0F
+#define	XK_ISO_Left_Tab					0xFE20
+#define	XK_ISO_Move_Line_Up				0xFE21
+#define	XK_ISO_Move_Line_Down				0xFE22
+#define	XK_ISO_Partial_Line_Up				0xFE23
+#define	XK_ISO_Partial_Line_Down			0xFE24
+#define	XK_ISO_Partial_Space_Left			0xFE25
+#define	XK_ISO_Partial_Space_Right			0xFE26
+#define	XK_ISO_Set_Margin_Left				0xFE27
+#define	XK_ISO_Set_Margin_Right				0xFE28
+#define	XK_ISO_Release_Margin_Left			0xFE29
+#define	XK_ISO_Release_Margin_Right			0xFE2A
+#define	XK_ISO_Release_Both_Margins			0xFE2B
+#define	XK_ISO_Fast_Cursor_Left				0xFE2C
+#define	XK_ISO_Fast_Cursor_Right			0xFE2D
+#define	XK_ISO_Fast_Cursor_Up				0xFE2E
+#define	XK_ISO_Fast_Cursor_Down				0xFE2F
+#define	XK_ISO_Continuous_Underline			0xFE30
+#define	XK_ISO_Discontinuous_Underline			0xFE31
+#define	XK_ISO_Emphasize				0xFE32
+#define	XK_ISO_Center_Object				0xFE33
+#define	XK_ISO_Enter					0xFE34
+#define	XK_dead_grave					0xFE50
+#define	XK_dead_acute					0xFE51
+#define	XK_dead_circumflex				0xFE52
+#define	XK_dead_tilde					0xFE53
+#define	XK_dead_macron					0xFE54
+#define	XK_dead_breve					0xFE55
+#define	XK_dead_abovedot				0xFE56
+#define	XK_dead_diaeresis				0xFE57
+#define	XK_dead_abovering				0xFE58
+#define	XK_dead_doubleacute				0xFE59
+#define	XK_dead_caron					0xFE5A
+#define	XK_dead_cedilla					0xFE5B
+#define	XK_dead_ogonek					0xFE5C
+#define	XK_dead_iota					0xFE5D
+#define	XK_dead_voiced_sound				0xFE5E
+#define	XK_dead_semivoiced_sound			0xFE5F
+#define	XK_dead_belowdot				0xFE60
+#define	XK_First_Virtual_Screen				0xFED0
+#define	XK_Prev_Virtual_Screen				0xFED1
+#define	XK_Next_Virtual_Screen				0xFED2
+#define	XK_Last_Virtual_Screen				0xFED4
+#define	XK_Terminate_Server				0xFED5
+#define	XK_AccessX_Enable				0xFE70
+#define	XK_AccessX_Feedback_Enable			0xFE71
+#define	XK_RepeatKeys_Enable				0xFE72
+#define	XK_SlowKeys_Enable				0xFE73
+#define	XK_BounceKeys_Enable				0xFE74
+#define	XK_StickyKeys_Enable				0xFE75
+#define	XK_MouseKeys_Enable				0xFE76
+#define	XK_MouseKeys_Accel_Enable			0xFE77
+#define	XK_Overlay1_Enable				0xFE78
+#define	XK_Overlay2_Enable				0xFE79
+#define	XK_AudibleBell_Enable				0xFE7A
+#define	XK_Pointer_Left					0xFEE0
+#define	XK_Pointer_Right				0xFEE1
+#define	XK_Pointer_Up					0xFEE2
+#define	XK_Pointer_Down					0xFEE3
+#define	XK_Pointer_UpLeft				0xFEE4
+#define	XK_Pointer_UpRight				0xFEE5
+#define	XK_Pointer_DownLeft				0xFEE6
+#define	XK_Pointer_DownRight				0xFEE7
+#define	XK_Pointer_Button_Dflt				0xFEE8
+#define	XK_Pointer_Button1				0xFEE9
+#define	XK_Pointer_Button2				0xFEEA
+#define	XK_Pointer_Button3				0xFEEB
+#define	XK_Pointer_Button4				0xFEEC
+#define	XK_Pointer_Button5				0xFEED
+#define	XK_Pointer_DblClick_Dflt			0xFEEE
+#define	XK_Pointer_DblClick1				0xFEEF
+#define	XK_Pointer_DblClick2				0xFEF0
+#define	XK_Pointer_DblClick3				0xFEF1
+#define	XK_Pointer_DblClick4				0xFEF2
+#define	XK_Pointer_DblClick5				0xFEF3
+#define	XK_Pointer_Drag_Dflt				0xFEF4
+#define	XK_Pointer_Drag1				0xFEF5
+#define	XK_Pointer_Drag2				0xFEF6
+#define	XK_Pointer_Drag3				0xFEF7
+#define	XK_Pointer_Drag4				0xFEF8
+#define	XK_Pointer_Drag5				0xFEFD
+#define	XK_Pointer_EnableKeys				0xFEF9
+#define	XK_Pointer_Accelerate				0xFEFA
+#define	XK_Pointer_DfltBtnNext				0xFEFB
+#define	XK_Pointer_DfltBtnPrev				0xFEFC
+#define XK_3270_Duplicate      0xFD01
+#define XK_3270_FieldMark      0xFD02
+#define XK_3270_Right2         0xFD03
+#define XK_3270_Left2          0xFD04
+#define XK_3270_BackTab        0xFD05
+#define XK_3270_EraseEOF       0xFD06
+#define XK_3270_EraseInput     0xFD07
+#define XK_3270_Reset          0xFD08
+#define XK_3270_Quit           0xFD09
+#define XK_3270_PA1            0xFD0A
+#define XK_3270_PA2            0xFD0B
+#define XK_3270_PA3            0xFD0C
+#define XK_3270_Test           0xFD0D
+#define XK_3270_Attn           0xFD0E
+#define XK_3270_CursorBlink    0xFD0F
+#define XK_3270_AltCursor      0xFD10
+#define XK_3270_KeyClick       0xFD11
+#define XK_3270_Jump           0xFD12
+#define XK_3270_Ident          0xFD13
+#define XK_3270_Rule           0xFD14
+#define XK_3270_Copy           0xFD15
+#define XK_3270_Play           0xFD16
+#define XK_3270_Setup          0xFD17
+#define XK_3270_Record         0xFD18
+#define XK_3270_ChangeScreen   0xFD19
+#define XK_3270_DeleteWord     0xFD1A
+#define XK_3270_ExSelect       0xFD1B
+#define XK_3270_CursorSelect   0xFD1C
+#define XK_3270_PrintScreen    0xFD1D
+#define XK_3270_Enter          0xFD1E
+#define XK_space               0x020
+#define XK_exclam              0x021
+#define XK_quotedbl            0x022
+#define XK_numbersign          0x023
+#define XK_dollar              0x024
+#define XK_percent             0x025
+#define XK_ampersand           0x026
+#define XK_apostrophe          0x027
+#define XK_quoteright          0x027	/* deprecated */
+#define XK_parenleft           0x028
+#define XK_parenright          0x029
+#define XK_asterisk            0x02a
+#define XK_plus                0x02b
+#define XK_comma               0x02c
+#define XK_minus               0x02d
+#define XK_period              0x02e
+#define XK_slash               0x02f
+#define XK_0                   0x030
+#define XK_1                   0x031
+#define XK_2                   0x032
+#define XK_3                   0x033
+#define XK_4                   0x034
+#define XK_5                   0x035
+#define XK_6                   0x036
+#define XK_7                   0x037
+#define XK_8                   0x038
+#define XK_9                   0x039
+#define XK_colon               0x03a
+#define XK_semicolon           0x03b
+#define XK_less                0x03c
+#define XK_equal               0x03d
+#define XK_greater             0x03e
+#define XK_question            0x03f
+#define XK_at                  0x040
+#define XK_A                   0x041
+#define XK_B                   0x042
+#define XK_C                   0x043
+#define XK_D                   0x044
+#define XK_E                   0x045
+#define XK_F                   0x046
+#define XK_G                   0x047
+#define XK_H                   0x048
+#define XK_I                   0x049
+#define XK_J                   0x04a
+#define XK_K                   0x04b
+#define XK_L                   0x04c
+#define XK_M                   0x04d
+#define XK_N                   0x04e
+#define XK_O                   0x04f
+#define XK_P                   0x050
+#define XK_Q                   0x051
+#define XK_R                   0x052
+#define XK_S                   0x053
+#define XK_T                   0x054
+#define XK_U                   0x055
+#define XK_V                   0x056
+#define XK_W                   0x057
+#define XK_X                   0x058
+#define XK_Y                   0x059
+#define XK_Z                   0x05a
+#define XK_bracketleft         0x05b
+#define XK_backslash           0x05c
+#define XK_bracketright        0x05d
+#define XK_asciicircum         0x05e
+#define XK_underscore          0x05f
+#define XK_grave               0x060
+#define XK_quoteleft           0x060	/* deprecated */
+#define XK_a                   0x061
+#define XK_b                   0x062
+#define XK_c                   0x063
+#define XK_d                   0x064
+#define XK_e                   0x065
+#define XK_f                   0x066
+#define XK_g                   0x067
+#define XK_h                   0x068
+#define XK_i                   0x069
+#define XK_j                   0x06a
+#define XK_k                   0x06b
+#define XK_l                   0x06c
+#define XK_m                   0x06d
+#define XK_n                   0x06e
+#define XK_o                   0x06f
+#define XK_p                   0x070
+#define XK_q                   0x071
+#define XK_r                   0x072
+#define XK_s                   0x073
+#define XK_t                   0x074
+#define XK_u                   0x075
+#define XK_v                   0x076
+#define XK_w                   0x077
+#define XK_x                   0x078
+#define XK_y                   0x079
+#define XK_z                   0x07a
+#define XK_braceleft           0x07b
+#define XK_bar                 0x07c
+#define XK_braceright          0x07d
+#define XK_asciitilde          0x07e
+#define XK_nobreakspace        0x0a0
+#define XK_exclamdown          0x0a1
+#define XK_cent        	       0x0a2
+#define XK_sterling            0x0a3
+#define XK_currency            0x0a4
+#define XK_yen                 0x0a5
+#define XK_brokenbar           0x0a6
+#define XK_section             0x0a7
+#define XK_diaeresis           0x0a8
+#define XK_copyright           0x0a9
+#define XK_ordfeminine         0x0aa
+#define XK_guillemotleft       0x0ab	/* left angle quotation mark */
+#define XK_notsign             0x0ac
+#define XK_hyphen              0x0ad
+#define XK_registered          0x0ae
+#define XK_macron              0x0af
+#define XK_degree              0x0b0
+#define XK_plusminus           0x0b1
+#define XK_twosuperior         0x0b2
+#define XK_threesuperior       0x0b3
+#define XK_acute               0x0b4
+#define XK_mu                  0x0b5
+#define XK_paragraph           0x0b6
+#define XK_periodcentered      0x0b7
+#define XK_cedilla             0x0b8
+#define XK_onesuperior         0x0b9
+#define XK_masculine           0x0ba
+#define XK_guillemotright      0x0bb	/* right angle quotation mark */
+#define XK_onequarter          0x0bc
+#define XK_onehalf             0x0bd
+#define XK_threequarters       0x0be
+#define XK_questiondown        0x0bf
+#define XK_Agrave              0x0c0
+#define XK_Aacute              0x0c1
+#define XK_Acircumflex         0x0c2
+#define XK_Atilde              0x0c3
+#define XK_Adiaeresis          0x0c4
+#define XK_Aring               0x0c5
+#define XK_AE                  0x0c6
+#define XK_Ccedilla            0x0c7
+#define XK_Egrave              0x0c8
+#define XK_Eacute              0x0c9
+#define XK_Ecircumflex         0x0ca
+#define XK_Ediaeresis          0x0cb
+#define XK_Igrave              0x0cc
+#define XK_Iacute              0x0cd
+#define XK_Icircumflex         0x0ce
+#define XK_Idiaeresis          0x0cf
+#define XK_ETH                 0x0d0
+#define XK_Eth                 0x0d0	/* deprecated */
+#define XK_Ntilde              0x0d1
+#define XK_Ograve              0x0d2
+#define XK_Oacute              0x0d3
+#define XK_Ocircumflex         0x0d4
+#define XK_Otilde              0x0d5
+#define XK_Odiaeresis          0x0d6
+#define XK_multiply            0x0d7
+#define XK_Ooblique            0x0d8
+#define XK_Ugrave              0x0d9
+#define XK_Uacute              0x0da
+#define XK_Ucircumflex         0x0db
+#define XK_Udiaeresis          0x0dc
+#define XK_Yacute              0x0dd
+#define XK_THORN               0x0de
+#define XK_Thorn               0x0de	/* deprecated */
+#define XK_ssharp              0x0df
+#define XK_agrave              0x0e0
+#define XK_aacute              0x0e1
+#define XK_acircumflex         0x0e2
+#define XK_atilde              0x0e3
+#define XK_adiaeresis          0x0e4
+#define XK_aring               0x0e5
+#define XK_ae                  0x0e6
+#define XK_ccedilla            0x0e7
+#define XK_egrave              0x0e8
+#define XK_eacute              0x0e9
+#define XK_ecircumflex         0x0ea
+#define XK_ediaeresis          0x0eb
+#define XK_igrave              0x0ec
+#define XK_iacute              0x0ed
+#define XK_icircumflex         0x0ee
+#define XK_idiaeresis          0x0ef
+#define XK_eth                 0x0f0
+#define XK_ntilde              0x0f1
+#define XK_ograve              0x0f2
+#define XK_oacute              0x0f3
+#define XK_ocircumflex         0x0f4
+#define XK_otilde              0x0f5
+#define XK_odiaeresis          0x0f6
+#define XK_division            0x0f7
+#define XK_oslash              0x0f8
+#define XK_ugrave              0x0f9
+#define XK_uacute              0x0fa
+#define XK_ucircumflex         0x0fb
+#define XK_udiaeresis          0x0fc
+#define XK_yacute              0x0fd
+#define XK_thorn               0x0fe
+#define XK_ydiaeresis          0x0ff
+#define XK_Aogonek             0x1a1
+#define XK_breve               0x1a2
+#define XK_Lstroke             0x1a3
+#define XK_Lcaron              0x1a5
+#define XK_Sacute              0x1a6
+#define XK_Scaron              0x1a9
+#define XK_Scedilla            0x1aa
+#define XK_Tcaron              0x1ab
+#define XK_Zacute              0x1ac
+#define XK_Zcaron              0x1ae
+#define XK_Zabovedot           0x1af
+#define XK_aogonek             0x1b1
+#define XK_ogonek              0x1b2
+#define XK_lstroke             0x1b3
+#define XK_lcaron              0x1b5
+#define XK_sacute              0x1b6
+#define XK_caron               0x1b7
+#define XK_scaron              0x1b9
+#define XK_scedilla            0x1ba
+#define XK_tcaron              0x1bb
+#define XK_zacute              0x1bc
+#define XK_doubleacute         0x1bd
+#define XK_zcaron              0x1be
+#define XK_zabovedot           0x1bf
+#define XK_Racute              0x1c0
+#define XK_Abreve              0x1c3
+#define XK_Lacute              0x1c5
+#define XK_Cacute              0x1c6
+#define XK_Ccaron              0x1c8
+#define XK_Eogonek             0x1ca
+#define XK_Ecaron              0x1cc
+#define XK_Dcaron              0x1cf
+#define XK_Dstroke             0x1d0
+#define XK_Nacute              0x1d1
+#define XK_Ncaron              0x1d2
+#define XK_Odoubleacute        0x1d5
+#define XK_Rcaron              0x1d8
+#define XK_Uring               0x1d9
+#define XK_Udoubleacute        0x1db
+#define XK_Tcedilla            0x1de
+#define XK_racute              0x1e0
+#define XK_abreve              0x1e3
+#define XK_lacute              0x1e5
+#define XK_cacute              0x1e6
+#define XK_ccaron              0x1e8
+#define XK_eogonek             0x1ea
+#define XK_ecaron              0x1ec
+#define XK_dcaron              0x1ef
+#define XK_dstroke             0x1f0
+#define XK_nacute              0x1f1
+#define XK_ncaron              0x1f2
+#define XK_odoubleacute        0x1f5
+#define XK_udoubleacute        0x1fb
+#define XK_rcaron              0x1f8
+#define XK_uring               0x1f9
+#define XK_tcedilla            0x1fe
+#define XK_abovedot            0x1ff
+#define XK_Hstroke             0x2a1
+#define XK_Hcircumflex         0x2a6
+#define XK_Iabovedot           0x2a9
+#define XK_Gbreve              0x2ab
+#define XK_Jcircumflex         0x2ac
+#define XK_hstroke             0x2b1
+#define XK_hcircumflex         0x2b6
+#define XK_idotless            0x2b9
+#define XK_gbreve              0x2bb
+#define XK_jcircumflex         0x2bc
+#define XK_Cabovedot           0x2c5
+#define XK_Ccircumflex         0x2c6
+#define XK_Gabovedot           0x2d5
+#define XK_Gcircumflex         0x2d8
+#define XK_Ubreve              0x2dd
+#define XK_Scircumflex         0x2de
+#define XK_cabovedot           0x2e5
+#define XK_ccircumflex         0x2e6
+#define XK_gabovedot           0x2f5
+#define XK_gcircumflex         0x2f8
+#define XK_ubreve              0x2fd
+#define XK_scircumflex         0x2fe
+#define XK_kra                 0x3a2
+#define XK_kappa               0x3a2	/* deprecated */
+#define XK_Rcedilla            0x3a3
+#define XK_Itilde              0x3a5
+#define XK_Lcedilla            0x3a6
+#define XK_Emacron             0x3aa
+#define XK_Gcedilla            0x3ab
+#define XK_Tslash              0x3ac
+#define XK_rcedilla            0x3b3
+#define XK_itilde              0x3b5
+#define XK_lcedilla            0x3b6
+#define XK_emacron             0x3ba
+#define XK_gcedilla            0x3bb
+#define XK_tslash              0x3bc
+#define XK_ENG                 0x3bd
+#define XK_eng                 0x3bf
+#define XK_Amacron             0x3c0
+#define XK_Iogonek             0x3c7
+#define XK_Eabovedot           0x3cc
+#define XK_Imacron             0x3cf
+#define XK_Ncedilla            0x3d1
+#define XK_Omacron             0x3d2
+#define XK_Kcedilla            0x3d3
+#define XK_Uogonek             0x3d9
+#define XK_Utilde              0x3dd
+#define XK_Umacron             0x3de
+#define XK_amacron             0x3e0
+#define XK_iogonek             0x3e7
+#define XK_eabovedot           0x3ec
+#define XK_imacron             0x3ef
+#define XK_ncedilla            0x3f1
+#define XK_omacron             0x3f2
+#define XK_kcedilla            0x3f3
+#define XK_uogonek             0x3f9
+#define XK_utilde              0x3fd
+#define XK_umacron             0x3fe
+#define XK_overline				       0x47e
+#define XK_kana_fullstop                               0x4a1
+#define XK_kana_openingbracket                         0x4a2
+#define XK_kana_closingbracket                         0x4a3
+#define XK_kana_comma                                  0x4a4
+#define XK_kana_conjunctive                            0x4a5
+#define XK_kana_middledot                              0x4a5  /* deprecated */
+#define XK_kana_WO                                     0x4a6
+#define XK_kana_a                                      0x4a7
+#define XK_kana_i                                      0x4a8
+#define XK_kana_u                                      0x4a9
+#define XK_kana_e                                      0x4aa
+#define XK_kana_o                                      0x4ab
+#define XK_kana_ya                                     0x4ac
+#define XK_kana_yu                                     0x4ad
+#define XK_kana_yo                                     0x4ae
+#define XK_kana_tsu                                    0x4af
+#define XK_kana_tu                                     0x4af  /* deprecated */
+#define XK_prolongedsound                              0x4b0
+#define XK_kana_A                                      0x4b1
+#define XK_kana_I                                      0x4b2
+#define XK_kana_U                                      0x4b3
+#define XK_kana_E                                      0x4b4
+#define XK_kana_O                                      0x4b5
+#define XK_kana_KA                                     0x4b6
+#define XK_kana_KI                                     0x4b7
+#define XK_kana_KU                                     0x4b8
+#define XK_kana_KE                                     0x4b9
+#define XK_kana_KO                                     0x4ba
+#define XK_kana_SA                                     0x4bb
+#define XK_kana_SHI                                    0x4bc
+#define XK_kana_SU                                     0x4bd
+#define XK_kana_SE                                     0x4be
+#define XK_kana_SO                                     0x4bf
+#define XK_kana_TA                                     0x4c0
+#define XK_kana_CHI                                    0x4c1
+#define XK_kana_TI                                     0x4c1  /* deprecated */
+#define XK_kana_TSU                                    0x4c2
+#define XK_kana_TU                                     0x4c2  /* deprecated */
+#define XK_kana_TE                                     0x4c3
+#define XK_kana_TO                                     0x4c4
+#define XK_kana_NA                                     0x4c5
+#define XK_kana_NI                                     0x4c6
+#define XK_kana_NU                                     0x4c7
+#define XK_kana_NE                                     0x4c8
+#define XK_kana_NO                                     0x4c9
+#define XK_kana_HA                                     0x4ca
+#define XK_kana_HI                                     0x4cb
+#define XK_kana_FU                                     0x4cc
+#define XK_kana_HU                                     0x4cc  /* deprecated */
+#define XK_kana_HE                                     0x4cd
+#define XK_kana_HO                                     0x4ce
+#define XK_kana_MA                                     0x4cf
+#define XK_kana_MI                                     0x4d0
+#define XK_kana_MU                                     0x4d1
+#define XK_kana_ME                                     0x4d2
+#define XK_kana_MO                                     0x4d3
+#define XK_kana_YA                                     0x4d4
+#define XK_kana_YU                                     0x4d5
+#define XK_kana_YO                                     0x4d6
+#define XK_kana_RA                                     0x4d7
+#define XK_kana_RI                                     0x4d8
+#define XK_kana_RU                                     0x4d9
+#define XK_kana_RE                                     0x4da
+#define XK_kana_RO                                     0x4db
+#define XK_kana_WA                                     0x4dc
+#define XK_kana_N                                      0x4dd
+#define XK_voicedsound                                 0x4de
+#define XK_semivoicedsound                             0x4df
+#define XK_kana_switch          0xFF7E  /* Alias for mode_switch */
+#define XK_Arabic_comma                                0x5ac
+#define XK_Arabic_semicolon                            0x5bb
+#define XK_Arabic_question_mark                        0x5bf
+#define XK_Arabic_hamza                                0x5c1
+#define XK_Arabic_maddaonalef                          0x5c2
+#define XK_Arabic_hamzaonalef                          0x5c3
+#define XK_Arabic_hamzaonwaw                           0x5c4
+#define XK_Arabic_hamzaunderalef                       0x5c5
+#define XK_Arabic_hamzaonyeh                           0x5c6
+#define XK_Arabic_alef                                 0x5c7
+#define XK_Arabic_beh                                  0x5c8
+#define XK_Arabic_tehmarbuta                           0x5c9
+#define XK_Arabic_teh                                  0x5ca
+#define XK_Arabic_theh                                 0x5cb
+#define XK_Arabic_jeem                                 0x5cc
+#define XK_Arabic_hah                                  0x5cd
+#define XK_Arabic_khah                                 0x5ce
+#define XK_Arabic_dal                                  0x5cf
+#define XK_Arabic_thal                                 0x5d0
+#define XK_Arabic_ra                                   0x5d1
+#define XK_Arabic_zain                                 0x5d2
+#define XK_Arabic_seen                                 0x5d3
+#define XK_Arabic_sheen                                0x5d4
+#define XK_Arabic_sad                                  0x5d5
+#define XK_Arabic_dad                                  0x5d6
+#define XK_Arabic_tah                                  0x5d7
+#define XK_Arabic_zah                                  0x5d8
+#define XK_Arabic_ain                                  0x5d9
+#define XK_Arabic_ghain                                0x5da
+#define XK_Arabic_tatweel                              0x5e0
+#define XK_Arabic_feh                                  0x5e1
+#define XK_Arabic_qaf                                  0x5e2
+#define XK_Arabic_kaf                                  0x5e3
+#define XK_Arabic_lam                                  0x5e4
+#define XK_Arabic_meem                                 0x5e5
+#define XK_Arabic_noon                                 0x5e6
+#define XK_Arabic_ha                                   0x5e7
+#define XK_Arabic_heh                                  0x5e7  /* deprecated */
+#define XK_Arabic_waw                                  0x5e8
+#define XK_Arabic_alefmaksura                          0x5e9
+#define XK_Arabic_yeh                                  0x5ea
+#define XK_Arabic_fathatan                             0x5eb
+#define XK_Arabic_dammatan                             0x5ec
+#define XK_Arabic_kasratan                             0x5ed
+#define XK_Arabic_fatha                                0x5ee
+#define XK_Arabic_damma                                0x5ef
+#define XK_Arabic_kasra                                0x5f0
+#define XK_Arabic_shadda                               0x5f1
+#define XK_Arabic_sukun                                0x5f2
+#define XK_Arabic_switch        0xFF7E  /* Alias for mode_switch */
+#define XK_Serbian_dje                                 0x6a1
+#define XK_Macedonia_gje                               0x6a2
+#define XK_Cyrillic_io                                 0x6a3
+#define XK_Ukrainian_ie                                0x6a4
+#define XK_Ukranian_je                                 0x6a4  /* deprecated */
+#define XK_Macedonia_dse                               0x6a5
+#define XK_Ukrainian_i                                 0x6a6
+#define XK_Ukranian_i                                  0x6a6  /* deprecated */
+#define XK_Ukrainian_yi                                0x6a7
+#define XK_Ukranian_yi                                 0x6a7  /* deprecated */
+#define XK_Cyrillic_je                                 0x6a8
+#define XK_Serbian_je                                  0x6a8  /* deprecated */
+#define XK_Cyrillic_lje                                0x6a9
+#define XK_Serbian_lje                                 0x6a9  /* deprecated */
+#define XK_Cyrillic_nje                                0x6aa
+#define XK_Serbian_nje                                 0x6aa  /* deprecated */
+#define XK_Serbian_tshe                                0x6ab
+#define XK_Macedonia_kje                               0x6ac
+#define XK_Byelorussian_shortu                         0x6ae
+#define XK_Cyrillic_dzhe                               0x6af
+#define XK_Serbian_dze                                 0x6af  /* deprecated */
+#define XK_numerosign                                  0x6b0
+#define XK_Serbian_DJE                                 0x6b1
+#define XK_Macedonia_GJE                               0x6b2
+#define XK_Cyrillic_IO                                 0x6b3
+#define XK_Ukrainian_IE                                0x6b4
+#define XK_Ukranian_JE                                 0x6b4  /* deprecated */
+#define XK_Macedonia_DSE                               0x6b5
+#define XK_Ukrainian_I                                 0x6b6
+#define XK_Ukranian_I                                  0x6b6  /* deprecated */
+#define XK_Ukrainian_YI                                0x6b7
+#define XK_Ukranian_YI                                 0x6b7  /* deprecated */
+#define XK_Cyrillic_JE                                 0x6b8
+#define XK_Serbian_JE                                  0x6b8  /* deprecated */
+#define XK_Cyrillic_LJE                                0x6b9
+#define XK_Serbian_LJE                                 0x6b9  /* deprecated */
+#define XK_Cyrillic_NJE                                0x6ba
+#define XK_Serbian_NJE                                 0x6ba  /* deprecated */
+#define XK_Serbian_TSHE                                0x6bb
+#define XK_Macedonia_KJE                               0x6bc
+#define XK_Byelorussian_SHORTU                         0x6be
+#define XK_Cyrillic_DZHE                               0x6bf
+#define XK_Serbian_DZE                                 0x6bf  /* deprecated */
+#define XK_Cyrillic_yu                                 0x6c0
+#define XK_Cyrillic_a                                  0x6c1
+#define XK_Cyrillic_be                                 0x6c2
+#define XK_Cyrillic_tse                                0x6c3
+#define XK_Cyrillic_de                                 0x6c4
+#define XK_Cyrillic_ie                                 0x6c5
+#define XK_Cyrillic_ef                                 0x6c6
+#define XK_Cyrillic_ghe                                0x6c7
+#define XK_Cyrillic_ha                                 0x6c8
+#define XK_Cyrillic_i                                  0x6c9
+#define XK_Cyrillic_shorti                             0x6ca
+#define XK_Cyrillic_ka                                 0x6cb
+#define XK_Cyrillic_el                                 0x6cc
+#define XK_Cyrillic_em                                 0x6cd
+#define XK_Cyrillic_en                                 0x6ce
+#define XK_Cyrillic_o                                  0x6cf
+#define XK_Cyrillic_pe                                 0x6d0
+#define XK_Cyrillic_ya                                 0x6d1
+#define XK_Cyrillic_er                                 0x6d2
+#define XK_Cyrillic_es                                 0x6d3
+#define XK_Cyrillic_te                                 0x6d4
+#define XK_Cyrillic_u                                  0x6d5
+#define XK_Cyrillic_zhe                                0x6d6
+#define XK_Cyrillic_ve                                 0x6d7
+#define XK_Cyrillic_softsign                           0x6d8
+#define XK_Cyrillic_yeru                               0x6d9
+#define XK_Cyrillic_ze                                 0x6da
+#define XK_Cyrillic_sha                                0x6db
+#define XK_Cyrillic_e                                  0x6dc
+#define XK_Cyrillic_shcha                              0x6dd
+#define XK_Cyrillic_che                                0x6de
+#define XK_Cyrillic_hardsign                           0x6df
+#define XK_Cyrillic_YU                                 0x6e0
+#define XK_Cyrillic_A                                  0x6e1
+#define XK_Cyrillic_BE                                 0x6e2
+#define XK_Cyrillic_TSE                                0x6e3
+#define XK_Cyrillic_DE                                 0x6e4
+#define XK_Cyrillic_IE                                 0x6e5
+#define XK_Cyrillic_EF                                 0x6e6
+#define XK_Cyrillic_GHE                                0x6e7
+#define XK_Cyrillic_HA                                 0x6e8
+#define XK_Cyrillic_I                                  0x6e9
+#define XK_Cyrillic_SHORTI                             0x6ea
+#define XK_Cyrillic_KA                                 0x6eb
+#define XK_Cyrillic_EL                                 0x6ec
+#define XK_Cyrillic_EM                                 0x6ed
+#define XK_Cyrillic_EN                                 0x6ee
+#define XK_Cyrillic_O                                  0x6ef
+#define XK_Cyrillic_PE                                 0x6f0
+#define XK_Cyrillic_YA                                 0x6f1
+#define XK_Cyrillic_ER                                 0x6f2
+#define XK_Cyrillic_ES                                 0x6f3
+#define XK_Cyrillic_TE                                 0x6f4
+#define XK_Cyrillic_U                                  0x6f5
+#define XK_Cyrillic_ZHE                                0x6f6
+#define XK_Cyrillic_VE                                 0x6f7
+#define XK_Cyrillic_SOFTSIGN                           0x6f8
+#define XK_Cyrillic_YERU                               0x6f9
+#define XK_Cyrillic_ZE                                 0x6fa
+#define XK_Cyrillic_SHA                                0x6fb
+#define XK_Cyrillic_E                                  0x6fc
+#define XK_Cyrillic_SHCHA                              0x6fd
+#define XK_Cyrillic_CHE                                0x6fe
+#define XK_Cyrillic_HARDSIGN                           0x6ff
+#define XK_Greek_ALPHAaccent                           0x7a1
+#define XK_Greek_EPSILONaccent                         0x7a2
+#define XK_Greek_ETAaccent                             0x7a3
+#define XK_Greek_IOTAaccent                            0x7a4
+#define XK_Greek_IOTAdiaeresis                         0x7a5
+#define XK_Greek_OMICRONaccent                         0x7a7
+#define XK_Greek_UPSILONaccent                         0x7a8
+#define XK_Greek_UPSILONdieresis                       0x7a9
+#define XK_Greek_OMEGAaccent                           0x7ab
+#define XK_Greek_accentdieresis                        0x7ae
+#define XK_Greek_horizbar                              0x7af
+#define XK_Greek_alphaaccent                           0x7b1
+#define XK_Greek_epsilonaccent                         0x7b2
+#define XK_Greek_etaaccent                             0x7b3
+#define XK_Greek_iotaaccent                            0x7b4
+#define XK_Greek_iotadieresis                          0x7b5
+#define XK_Greek_iotaaccentdieresis                    0x7b6
+#define XK_Greek_omicronaccent                         0x7b7
+#define XK_Greek_upsilonaccent                         0x7b8
+#define XK_Greek_upsilondieresis                       0x7b9
+#define XK_Greek_upsilonaccentdieresis                 0x7ba
+#define XK_Greek_omegaaccent                           0x7bb
+#define XK_Greek_ALPHA                                 0x7c1
+#define XK_Greek_BETA                                  0x7c2
+#define XK_Greek_GAMMA                                 0x7c3
+#define XK_Greek_DELTA                                 0x7c4
+#define XK_Greek_EPSILON                               0x7c5
+#define XK_Greek_ZETA                                  0x7c6
+#define XK_Greek_ETA                                   0x7c7
+#define XK_Greek_THETA                                 0x7c8
+#define XK_Greek_IOTA                                  0x7c9
+#define XK_Greek_KAPPA                                 0x7ca
+#define XK_Greek_LAMDA                                 0x7cb
+#define XK_Greek_LAMBDA                                0x7cb
+#define XK_Greek_MU                                    0x7cc
+#define XK_Greek_NU                                    0x7cd
+#define XK_Greek_XI                                    0x7ce
+#define XK_Greek_OMICRON                               0x7cf
+#define XK_Greek_PI                                    0x7d0
+#define XK_Greek_RHO                                   0x7d1
+#define XK_Greek_SIGMA                                 0x7d2
+#define XK_Greek_TAU                                   0x7d4
+#define XK_Greek_UPSILON                               0x7d5
+#define XK_Greek_PHI                                   0x7d6
+#define XK_Greek_CHI                                   0x7d7
+#define XK_Greek_PSI                                   0x7d8
+#define XK_Greek_OMEGA                                 0x7d9
+#define XK_Greek_alpha                                 0x7e1
+#define XK_Greek_beta                                  0x7e2
+#define XK_Greek_gamma                                 0x7e3
+#define XK_Greek_delta                                 0x7e4
+#define XK_Greek_epsilon                               0x7e5
+#define XK_Greek_zeta                                  0x7e6
+#define XK_Greek_eta                                   0x7e7
+#define XK_Greek_theta                                 0x7e8
+#define XK_Greek_iota                                  0x7e9
+#define XK_Greek_kappa                                 0x7ea
+#define XK_Greek_lamda                                 0x7eb
+#define XK_Greek_lambda                                0x7eb
+#define XK_Greek_mu                                    0x7ec
+#define XK_Greek_nu                                    0x7ed
+#define XK_Greek_xi                                    0x7ee
+#define XK_Greek_omicron                               0x7ef
+#define XK_Greek_pi                                    0x7f0
+#define XK_Greek_rho                                   0x7f1
+#define XK_Greek_sigma                                 0x7f2
+#define XK_Greek_finalsmallsigma                       0x7f3
+#define XK_Greek_tau                                   0x7f4
+#define XK_Greek_upsilon                               0x7f5
+#define XK_Greek_phi                                   0x7f6
+#define XK_Greek_chi                                   0x7f7
+#define XK_Greek_psi                                   0x7f8
+#define XK_Greek_omega                                 0x7f9
+#define XK_Greek_switch         0xFF7E  /* Alias for mode_switch */
+#define XK_leftradical                                 0x8a1
+#define XK_topleftradical                              0x8a2
+#define XK_horizconnector                              0x8a3
+#define XK_topintegral                                 0x8a4
+#define XK_botintegral                                 0x8a5
+#define XK_vertconnector                               0x8a6
+#define XK_topleftsqbracket                            0x8a7
+#define XK_botleftsqbracket                            0x8a8
+#define XK_toprightsqbracket                           0x8a9
+#define XK_botrightsqbracket                           0x8aa
+#define XK_topleftparens                               0x8ab
+#define XK_botleftparens                               0x8ac
+#define XK_toprightparens                              0x8ad
+#define XK_botrightparens                              0x8ae
+#define XK_leftmiddlecurlybrace                        0x8af
+#define XK_rightmiddlecurlybrace                       0x8b0
+#define XK_topleftsummation                            0x8b1
+#define XK_botleftsummation                            0x8b2
+#define XK_topvertsummationconnector                   0x8b3
+#define XK_botvertsummationconnector                   0x8b4
+#define XK_toprightsummation                           0x8b5
+#define XK_botrightsummation                           0x8b6
+#define XK_rightmiddlesummation                        0x8b7
+#define XK_lessthanequal                               0x8bc
+#define XK_notequal                                    0x8bd
+#define XK_greaterthanequal                            0x8be
+#define XK_integral                                    0x8bf
+#define XK_therefore                                   0x8c0
+#define XK_variation                                   0x8c1
+#define XK_infinity                                    0x8c2
+#define XK_nabla                                       0x8c5
+#define XK_approximate                                 0x8c8
+#define XK_similarequal                                0x8c9
+#define XK_ifonlyif                                    0x8cd
+#define XK_implies                                     0x8ce
+#define XK_identical                                   0x8cf
+#define XK_radical                                     0x8d6
+#define XK_includedin                                  0x8da
+#define XK_includes                                    0x8db
+#define XK_intersection                                0x8dc
+#define XK_union                                       0x8dd
+#define XK_logicaland                                  0x8de
+#define XK_logicalor                                   0x8df
+#define XK_partialderivative                           0x8ef
+#define XK_function                                    0x8f6
+#define XK_leftarrow                                   0x8fb
+#define XK_uparrow                                     0x8fc
+#define XK_rightarrow                                  0x8fd
+#define XK_downarrow                                   0x8fe
+#define XK_blank                                       0x9df
+#define XK_soliddiamond                                0x9e0
+#define XK_checkerboard                                0x9e1
+#define XK_ht                                          0x9e2
+#define XK_ff                                          0x9e3
+#define XK_cr                                          0x9e4
+#define XK_lf                                          0x9e5
+#define XK_nl                                          0x9e8
+#define XK_vt                                          0x9e9
+#define XK_lowrightcorner                              0x9ea
+#define XK_uprightcorner                               0x9eb
+#define XK_upleftcorner                                0x9ec
+#define XK_lowleftcorner                               0x9ed
+#define XK_crossinglines                               0x9ee
+#define XK_horizlinescan1                              0x9ef
+#define XK_horizlinescan3                              0x9f0
+#define XK_horizlinescan5                              0x9f1
+#define XK_horizlinescan7                              0x9f2
+#define XK_horizlinescan9                              0x9f3
+#define XK_leftt                                       0x9f4
+#define XK_rightt                                      0x9f5
+#define XK_bott                                        0x9f6
+#define XK_topt                                        0x9f7
+#define XK_vertbar                                     0x9f8
+#define XK_emspace                                     0xaa1
+#define XK_enspace                                     0xaa2
+#define XK_em3space                                    0xaa3
+#define XK_em4space                                    0xaa4
+#define XK_digitspace                                  0xaa5
+#define XK_punctspace                                  0xaa6
+#define XK_thinspace                                   0xaa7
+#define XK_hairspace                                   0xaa8
+#define XK_emdash                                      0xaa9
+#define XK_endash                                      0xaaa
+#define XK_signifblank                                 0xaac
+#define XK_ellipsis                                    0xaae
+#define XK_doubbaselinedot                             0xaaf
+#define XK_onethird                                    0xab0
+#define XK_twothirds                                   0xab1
+#define XK_onefifth                                    0xab2
+#define XK_twofifths                                   0xab3
+#define XK_threefifths                                 0xab4
+#define XK_fourfifths                                  0xab5
+#define XK_onesixth                                    0xab6
+#define XK_fivesixths                                  0xab7
+#define XK_careof                                      0xab8
+#define XK_figdash                                     0xabb
+#define XK_leftanglebracket                            0xabc
+#define XK_decimalpoint                                0xabd
+#define XK_rightanglebracket                           0xabe
+#define XK_marker                                      0xabf
+#define XK_oneeighth                                   0xac3
+#define XK_threeeighths                                0xac4
+#define XK_fiveeighths                                 0xac5
+#define XK_seveneighths                                0xac6
+#define XK_trademark                                   0xac9
+#define XK_signaturemark                               0xaca
+#define XK_trademarkincircle                           0xacb
+#define XK_leftopentriangle                            0xacc
+#define XK_rightopentriangle                           0xacd
+#define XK_emopencircle                                0xace
+#define XK_emopenrectangle                             0xacf
+#define XK_leftsinglequotemark                         0xad0
+#define XK_rightsinglequotemark                        0xad1
+#define XK_leftdoublequotemark                         0xad2
+#define XK_rightdoublequotemark                        0xad3
+#define XK_prescription                                0xad4
+#define XK_minutes                                     0xad6
+#define XK_seconds                                     0xad7
+#define XK_latincross                                  0xad9
+#define XK_hexagram                                    0xada
+#define XK_filledrectbullet                            0xadb
+#define XK_filledlefttribullet                         0xadc
+#define XK_filledrighttribullet                        0xadd
+#define XK_emfilledcircle                              0xade
+#define XK_emfilledrect                                0xadf
+#define XK_enopencircbullet                            0xae0
+#define XK_enopensquarebullet                          0xae1
+#define XK_openrectbullet                              0xae2
+#define XK_opentribulletup                             0xae3
+#define XK_opentribulletdown                           0xae4
+#define XK_openstar                                    0xae5
+#define XK_enfilledcircbullet                          0xae6
+#define XK_enfilledsqbullet                            0xae7
+#define XK_filledtribulletup                           0xae8
+#define XK_filledtribulletdown                         0xae9
+#define XK_leftpointer                                 0xaea
+#define XK_rightpointer                                0xaeb
+#define XK_club                                        0xaec
+#define XK_diamond                                     0xaed
+#define XK_heart                                       0xaee
+#define XK_maltesecross                                0xaf0
+#define XK_dagger                                      0xaf1
+#define XK_doubledagger                                0xaf2
+#define XK_checkmark                                   0xaf3
+#define XK_ballotcross                                 0xaf4
+#define XK_musicalsharp                                0xaf5
+#define XK_musicalflat                                 0xaf6
+#define XK_malesymbol                                  0xaf7
+#define XK_femalesymbol                                0xaf8
+#define XK_telephone                                   0xaf9
+#define XK_telephonerecorder                           0xafa
+#define XK_phonographcopyright                         0xafb
+#define XK_caret                                       0xafc
+#define XK_singlelowquotemark                          0xafd
+#define XK_doublelowquotemark                          0xafe
+#define XK_cursor                                      0xaff
+#define XK_leftcaret                                   0xba3
+#define XK_rightcaret                                  0xba6
+#define XK_downcaret                                   0xba8
+#define XK_upcaret                                     0xba9
+#define XK_overbar                                     0xbc0
+#define XK_downtack                                    0xbc2
+#define XK_upshoe                                      0xbc3
+#define XK_downstile                                   0xbc4
+#define XK_underbar                                    0xbc6
+#define XK_jot                                         0xbca
+#define XK_quad                                        0xbcc
+#define XK_uptack                                      0xbce
+#define XK_circle                                      0xbcf
+#define XK_upstile                                     0xbd3
+#define XK_downshoe                                    0xbd6
+#define XK_rightshoe                                   0xbd8
+#define XK_leftshoe                                    0xbda
+#define XK_lefttack                                    0xbdc
+#define XK_righttack                                   0xbfc
+#define XK_hebrew_doublelowline                        0xcdf
+#define XK_hebrew_aleph                                0xce0
+#define XK_hebrew_bet                                  0xce1
+#define XK_hebrew_beth                                 0xce1  /* deprecated */
+#define XK_hebrew_gimel                                0xce2
+#define XK_hebrew_gimmel                               0xce2  /* deprecated */
+#define XK_hebrew_dalet                                0xce3
+#define XK_hebrew_daleth                               0xce3  /* deprecated */
+#define XK_hebrew_he                                   0xce4
+#define XK_hebrew_waw                                  0xce5
+#define XK_hebrew_zain                                 0xce6
+#define XK_hebrew_zayin                                0xce6  /* deprecated */
+#define XK_hebrew_chet                                 0xce7
+#define XK_hebrew_het                                  0xce7  /* deprecated */
+#define XK_hebrew_tet                                  0xce8
+#define XK_hebrew_teth                                 0xce8  /* deprecated */
+#define XK_hebrew_yod                                  0xce9
+#define XK_hebrew_finalkaph                            0xcea
+#define XK_hebrew_kaph                                 0xceb
+#define XK_hebrew_lamed                                0xcec
+#define XK_hebrew_finalmem                             0xced
+#define XK_hebrew_mem                                  0xcee
+#define XK_hebrew_finalnun                             0xcef
+#define XK_hebrew_nun                                  0xcf0
+#define XK_hebrew_samech                               0xcf1
+#define XK_hebrew_samekh                               0xcf1  /* deprecated */
+#define XK_hebrew_ayin                                 0xcf2
+#define XK_hebrew_finalpe                              0xcf3
+#define XK_hebrew_pe                                   0xcf4
+#define XK_hebrew_finalzade                            0xcf5
+#define XK_hebrew_finalzadi                            0xcf5  /* deprecated */
+#define XK_hebrew_zade                                 0xcf6
+#define XK_hebrew_zadi                                 0xcf6  /* deprecated */
+#define XK_hebrew_qoph                                 0xcf7
+#define XK_hebrew_kuf                                  0xcf7  /* deprecated */
+#define XK_hebrew_resh                                 0xcf8
+#define XK_hebrew_shin                                 0xcf9
+#define XK_hebrew_taw                                  0xcfa
+#define XK_hebrew_taf                                  0xcfa  /* deprecated */
+#define XK_Hebrew_switch        0xFF7E  /* Alias for mode_switch */
+#define XK_Thai_kokai					0xda1
+#define XK_Thai_khokhai					0xda2
+#define XK_Thai_khokhuat				0xda3
+#define XK_Thai_khokhwai				0xda4
+#define XK_Thai_khokhon					0xda5
+#define XK_Thai_khorakhang			        0xda6  
+#define XK_Thai_ngongu					0xda7  
+#define XK_Thai_chochan					0xda8  
+#define XK_Thai_choching				0xda9   
+#define XK_Thai_chochang				0xdaa  
+#define XK_Thai_soso					0xdab
+#define XK_Thai_chochoe					0xdac
+#define XK_Thai_yoying					0xdad
+#define XK_Thai_dochada					0xdae
+#define XK_Thai_topatak					0xdaf
+#define XK_Thai_thothan					0xdb0
+#define XK_Thai_thonangmontho			        0xdb1
+#define XK_Thai_thophuthao			        0xdb2
+#define XK_Thai_nonen					0xdb3
+#define XK_Thai_dodek					0xdb4
+#define XK_Thai_totao					0xdb5
+#define XK_Thai_thothung				0xdb6
+#define XK_Thai_thothahan				0xdb7
+#define XK_Thai_thothong	 			0xdb8
+#define XK_Thai_nonu					0xdb9
+#define XK_Thai_bobaimai				0xdba
+#define XK_Thai_popla					0xdbb
+#define XK_Thai_phophung				0xdbc
+#define XK_Thai_fofa					0xdbd
+#define XK_Thai_phophan					0xdbe
+#define XK_Thai_fofan					0xdbf
+#define XK_Thai_phosamphao			        0xdc0
+#define XK_Thai_moma					0xdc1
+#define XK_Thai_yoyak					0xdc2
+#define XK_Thai_rorua					0xdc3
+#define XK_Thai_ru					0xdc4
+#define XK_Thai_loling					0xdc5
+#define XK_Thai_lu					0xdc6
+#define XK_Thai_wowaen					0xdc7
+#define XK_Thai_sosala					0xdc8
+#define XK_Thai_sorusi					0xdc9
+#define XK_Thai_sosua					0xdca
+#define XK_Thai_hohip					0xdcb
+#define XK_Thai_lochula					0xdcc
+#define XK_Thai_oang					0xdcd
+#define XK_Thai_honokhuk				0xdce
+#define XK_Thai_paiyannoi				0xdcf
+#define XK_Thai_saraa					0xdd0
+#define XK_Thai_maihanakat				0xdd1
+#define XK_Thai_saraaa					0xdd2
+#define XK_Thai_saraam					0xdd3
+#define XK_Thai_sarai					0xdd4   
+#define XK_Thai_saraii					0xdd5   
+#define XK_Thai_saraue					0xdd6    
+#define XK_Thai_sarauee					0xdd7    
+#define XK_Thai_sarau					0xdd8    
+#define XK_Thai_sarauu					0xdd9   
+#define XK_Thai_phinthu					0xdda
+#define XK_Thai_maihanakat_maitho   			0xdde
+#define XK_Thai_baht					0xddf
+#define XK_Thai_sarae					0xde0    
+#define XK_Thai_saraae					0xde1
+#define XK_Thai_sarao					0xde2
+#define XK_Thai_saraaimaimuan				0xde3   
+#define XK_Thai_saraaimaimalai				0xde4  
+#define XK_Thai_lakkhangyao				0xde5
+#define XK_Thai_maiyamok				0xde6
+#define XK_Thai_maitaikhu				0xde7
+#define XK_Thai_maiek					0xde8   
+#define XK_Thai_maitho					0xde9
+#define XK_Thai_maitri					0xdea
+#define XK_Thai_maichattawa				0xdeb
+#define XK_Thai_thanthakhat				0xdec
+#define XK_Thai_nikhahit				0xded
+#define XK_Thai_leksun					0xdf0 
+#define XK_Thai_leknung					0xdf1  
+#define XK_Thai_leksong					0xdf2 
+#define XK_Thai_leksam					0xdf3
+#define XK_Thai_leksi					0xdf4  
+#define XK_Thai_lekha					0xdf5  
+#define XK_Thai_lekhok					0xdf6  
+#define XK_Thai_lekchet					0xdf7  
+#define XK_Thai_lekpaet					0xdf8  
+#define XK_Thai_lekkao					0xdf9 
+#define XK_Hangul		0xff31    /* Hangul start/stop(toggle) */
+#define XK_Hangul_Start		0xff32    /* Hangul start */
+#define XK_Hangul_End		0xff33    /* Hangul end, English start */
+#define XK_Hangul_Hanja		0xff34    /* Start Hangul->Hanja Conversion */
+#define XK_Hangul_Jamo		0xff35    /* Hangul Jamo mode */
+#define XK_Hangul_Romaja	0xff36    /* Hangul Romaja mode */
+#define XK_Hangul_Codeinput	0xff37    /* Hangul code input mode */
+#define XK_Hangul_Jeonja	0xff38    /* Jeonja mode */
+#define XK_Hangul_Banja		0xff39    /* Banja mode */
+#define XK_Hangul_PreHanja	0xff3a    /* Pre Hanja conversion */
+#define XK_Hangul_PostHanja	0xff3b    /* Post Hanja conversion */
+#define XK_Hangul_SingleCandidate	0xff3c    /* Single candidate */
+#define XK_Hangul_MultipleCandidate	0xff3d    /* Multiple candidate */
+#define XK_Hangul_PreviousCandidate	0xff3e    /* Previous candidate */
+#define XK_Hangul_Special	0xff3f    /* Special symbols */
+#define XK_Hangul_switch	0xFF7E    /* Alias for mode_switch */
+#define XK_Hangul_Kiyeog				0xea1
+#define XK_Hangul_SsangKiyeog				0xea2
+#define XK_Hangul_KiyeogSios				0xea3
+#define XK_Hangul_Nieun					0xea4
+#define XK_Hangul_NieunJieuj				0xea5
+#define XK_Hangul_NieunHieuh				0xea6
+#define XK_Hangul_Dikeud				0xea7
+#define XK_Hangul_SsangDikeud				0xea8
+#define XK_Hangul_Rieul					0xea9
+#define XK_Hangul_RieulKiyeog				0xeaa
+#define XK_Hangul_RieulMieum				0xeab
+#define XK_Hangul_RieulPieub				0xeac
+#define XK_Hangul_RieulSios				0xead
+#define XK_Hangul_RieulTieut				0xeae
+#define XK_Hangul_RieulPhieuf				0xeaf
+#define XK_Hangul_RieulHieuh				0xeb0
+#define XK_Hangul_Mieum					0xeb1
+#define XK_Hangul_Pieub					0xeb2
+#define XK_Hangul_SsangPieub				0xeb3
+#define XK_Hangul_PieubSios				0xeb4
+#define XK_Hangul_Sios					0xeb5
+#define XK_Hangul_SsangSios				0xeb6
+#define XK_Hangul_Ieung					0xeb7
+#define XK_Hangul_Jieuj					0xeb8
+#define XK_Hangul_SsangJieuj				0xeb9
+#define XK_Hangul_Cieuc					0xeba
+#define XK_Hangul_Khieuq				0xebb
+#define XK_Hangul_Tieut					0xebc
+#define XK_Hangul_Phieuf				0xebd
+#define XK_Hangul_Hieuh					0xebe
+#define XK_Hangul_A					0xebf
+#define XK_Hangul_AE					0xec0
+#define XK_Hangul_YA					0xec1
+#define XK_Hangul_YAE					0xec2
+#define XK_Hangul_EO					0xec3
+#define XK_Hangul_E					0xec4
+#define XK_Hangul_YEO					0xec5
+#define XK_Hangul_YE					0xec6
+#define XK_Hangul_O					0xec7
+#define XK_Hangul_WA					0xec8
+#define XK_Hangul_WAE					0xec9
+#define XK_Hangul_OE					0xeca
+#define XK_Hangul_YO					0xecb
+#define XK_Hangul_U					0xecc
+#define XK_Hangul_WEO					0xecd
+#define XK_Hangul_WE					0xece
+#define XK_Hangul_WI					0xecf
+#define XK_Hangul_YU					0xed0
+#define XK_Hangul_EU					0xed1
+#define XK_Hangul_YI					0xed2
+#define XK_Hangul_I					0xed3
+#define XK_Hangul_J_Kiyeog				0xed4
+#define XK_Hangul_J_SsangKiyeog				0xed5
+#define XK_Hangul_J_KiyeogSios				0xed6
+#define XK_Hangul_J_Nieun				0xed7
+#define XK_Hangul_J_NieunJieuj				0xed8
+#define XK_Hangul_J_NieunHieuh				0xed9
+#define XK_Hangul_J_Dikeud				0xeda
+#define XK_Hangul_J_Rieul				0xedb
+#define XK_Hangul_J_RieulKiyeog				0xedc
+#define XK_Hangul_J_RieulMieum				0xedd
+#define XK_Hangul_J_RieulPieub				0xede
+#define XK_Hangul_J_RieulSios				0xedf
+#define XK_Hangul_J_RieulTieut				0xee0
+#define XK_Hangul_J_RieulPhieuf				0xee1
+#define XK_Hangul_J_RieulHieuh				0xee2
+#define XK_Hangul_J_Mieum				0xee3
+#define XK_Hangul_J_Pieub				0xee4
+#define XK_Hangul_J_PieubSios				0xee5
+#define XK_Hangul_J_Sios				0xee6
+#define XK_Hangul_J_SsangSios				0xee7
+#define XK_Hangul_J_Ieung				0xee8
+#define XK_Hangul_J_Jieuj				0xee9
+#define XK_Hangul_J_Cieuc				0xeea
+#define XK_Hangul_J_Khieuq				0xeeb
+#define XK_Hangul_J_Tieut				0xeec
+#define XK_Hangul_J_Phieuf				0xeed
+#define XK_Hangul_J_Hieuh				0xeee
+#define XK_Hangul_RieulYeorinHieuh			0xeef
+#define XK_Hangul_SunkyeongeumMieum			0xef0
+#define XK_Hangul_SunkyeongeumPieub			0xef1
+#define XK_Hangul_PanSios				0xef2
+#define XK_Hangul_KkogjiDalrinIeung			0xef3
+#define XK_Hangul_SunkyeongeumPhieuf			0xef4
+#define XK_Hangul_YeorinHieuh				0xef5
+#define XK_Hangul_AraeA					0xef6
+#define XK_Hangul_AraeAE				0xef7
+#define XK_Hangul_J_PanSios				0xef8
+#define XK_Hangul_J_KkogjiDalrinIeung			0xef9
+#define XK_Hangul_J_YeorinHieuh				0xefa
+#define XK_Korean_Won					0xeff
diff --git a/lib/modules/Protocols.pmod/X.pmod/my_struct.pmod b/lib/modules/Protocols.pmod/X.pmod/my_struct.pmod
index 1fd6859562ae257ba45d3d4a99014d05535d8eaa..4d58607461b8af5f67d399f4707b47c1f54cda5e 100644
--- a/lib/modules/Protocols.pmod/X.pmod/my_struct.pmod
+++ b/lib/modules/Protocols.pmod/X.pmod/my_struct.pmod
@@ -54,7 +54,7 @@ class struct {
   void put_bignum(object i, int|void len)
   {
     if (i<0)
-      error("ADT.struct->put_ubignum: negative argument.\n");
+      error("ADT.struct->put_bignum: negative argument.\n");
     put_var_string(i->digits(256), len || 2);
   }
 
@@ -105,7 +105,7 @@ class struct {
 
   object get_bignum(int|void len)
   {
-    return Gmp.mpz(get_var_string(len || 2), 256);
+//     return Gmp.mpz(get_var_string(len || 2), 256);
   }
 
   string get_rest()