--- src/eggaccelerators.c	2004/11/04 19:39:28	1.1
+++ src/eggaccelerators.c	2004/11/04 20:37:55
@@ -20,6 +20,7 @@
 
 #include "eggaccelerators.h"
 
+#include <stdlib.h>
 #include <string.h>
 #include <gdk/gdkx.h>
 #include <gdk/gdkkeysyms.h>
@@ -175,6 +176,13 @@ is_hyper (const gchar *string)
 	  (string[6] == '>'));
 }
 
+static inline gboolean
+is_keycode (const gchar *string)
+{
+  return ((string[0] == '0') &&
+	  (string[1] == 'x'));
+}
+
 /**
  * egg_accelerator_parse_virtual:
  * @accelerator:      string representing an accelerator
@@ -203,6 +211,7 @@ is_hyper (const gchar *string)
 gboolean
 egg_accelerator_parse_virtual (const gchar            *accelerator,
                                guint                  *accelerator_key,
+			       guint                  *keycode,
                                EggVirtualModifierType *accelerator_mods)
 {
   guint keyval;
@@ -214,6 +223,8 @@ egg_accelerator_parse_virtual (const gch
     *accelerator_key = 0;
   if (accelerator_mods)
     *accelerator_mods = 0;
+  if (keycode)
+    *keycode = 0;
 
   g_return_val_if_fail (accelerator != NULL, FALSE);
 
@@ -314,12 +325,40 @@ egg_accelerator_parse_virtual (const gch
       else
 	{
           keyval = gdk_keyval_from_name (accelerator);
-          
+
           if (keyval == 0)
-            bad_keyval = TRUE;
-          
+	    {
+	      /* If keyval is 0, than maybe it's a keycode.  Check for 0x## */
+	      if (len >= 4 && is_keycode (accelerator))
+		{
+		  char keystring[5];
+		  gchar *endptr;
+		  gint tmp_keycode;
+
+		  memcpy (keystring, accelerator, 4);
+		  keystring [4] = '\000';
+
+		  tmp_keycode = strtol (keystring, &endptr, 16);
+
+		  if (endptr == NULL || *endptr != '\000')
+		    {
+		      bad_keyval = TRUE;
+		    }
+		  else if (keycode != NULL)
+		    {
+		      *keycode = tmp_keycode;
+		      /* 0x00 is an invalid keycode too. */
+		      if (*keycode == 0)
+			bad_keyval = TRUE;
+		    }
+		}
+	    } else if (keycode != NULL)
+		/* This gets assigned later in reload_keycodes(), when we have
+		 * an X display and can call XKeysymToKeycode() */
+		*keycode = 0;
+
           accelerator += len;
-          len -= len;              
+          len -= len;
 	}
     }
   
@@ -347,6 +386,7 @@ egg_accelerator_parse_virtual (const gch
  */
 gchar*
 egg_virtual_accelerator_name (guint                  accelerator_key,
+			      guint		     keycode,
                               EggVirtualModifierType accelerator_mods)
 {
   static const gchar text_release[] = "<Release>";
@@ -366,9 +406,16 @@ egg_virtual_accelerator_name (guint     
 
   accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;
 
-  keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));
-  if (!keyval_name)
-    keyval_name = "";
+  if (!accelerator_key)
+    {
+      keyval_name = g_strdup_printf ("0x%02x", keycode);
+    }
+  else
+    {
+      keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));
+      if (!keyval_name)
+        keyval_name = "";
+    }
 
   l = 0;
   if (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)
--- src/eggaccelerators.h	2004/11/04 19:45:43	1.1
+++ src/eggaccelerators.h	2004/11/04 19:45:55
@@ -70,6 +70,7 @@ typedef enum
 
 gboolean egg_accelerator_parse_virtual        (const gchar            *accelerator,
                                                guint                  *accelerator_key,
+					       guint                  *keycode,
                                                EggVirtualModifierType *accelerator_mods);
 void     egg_keymap_resolve_virtual_modifiers (GdkKeymap              *keymap,
                                                EggVirtualModifierType  virtual_mods,
@@ -79,6 +80,7 @@ void     egg_keymap_virtualize_modifiers
                                                EggVirtualModifierType *virtual_mods);
 
 gchar* egg_virtual_accelerator_name (guint                  accelerator_key,
+				     guint		    keycode,
                                      EggVirtualModifierType accelerator_mods);
 
 G_END_DECLS
--- src/keybindings.c	2004/11/04 20:08:25	1.1
+++ src/keybindings.c	2004/11/05 00:59:06
@@ -548,8 +548,9 @@ reload_keycodes (MetaDisplay *display)
       i = 0;
       while (i < display->n_screen_bindings)
         {
-          display->screen_bindings[i].keycode = XKeysymToKeycode (display->xdisplay,
-                                                                  display->screen_bindings[i].keysym);
+	  if (display->screen_bindings[i].keycode == 0)
+	      display->screen_bindings[i].keycode = XKeysymToKeycode (
+		      display->xdisplay, display->screen_bindings[i].keysym);
           
           ++i;
         }
@@ -562,8 +563,9 @@ reload_keycodes (MetaDisplay *display)
       i = 0;
       while (i < display->n_window_bindings)
         {
-          display->window_bindings[i].keycode = XKeysymToKeycode (display->xdisplay,
-                                                                  display->window_bindings[i].keysym);
+	  if (display->window_bindings[i].keycode == 0)
+	      display->window_bindings[i].keycode = XKeysymToKeycode (
+		      display->xdisplay, display->window_bindings[i].keysym);
           
           ++i;
         }
@@ -630,7 +632,7 @@ count_bindings (const MetaKeyPref *prefs
   i = 0;
   while (i < n_prefs)
     {
-      if (prefs[i].keysym != None)
+      if (prefs[i].keysym != None || prefs[i].keycode != 0)
         {
           count += 1;
 
@@ -663,13 +665,13 @@ rebuild_binding_table (MetaDisplay      
   dest = 0;
   while (src < n_prefs)
     {
-      if (prefs[src].keysym != None)
+      if (prefs[src].keysym != None || prefs[src].keycode != 0)
         {
           (*bindings_p)[dest].name = prefs[src].name;
           (*bindings_p)[dest].keysym = prefs[src].keysym;
           (*bindings_p)[dest].modifiers = prefs[src].modifiers;
           (*bindings_p)[dest].mask = 0;
-          (*bindings_p)[dest].keycode = 0;          
+          (*bindings_p)[dest].keycode = prefs[src].keycode;
           
           ++dest;
 
@@ -685,7 +687,7 @@ rebuild_binding_table (MetaDisplay      
               (*bindings_p)[dest].modifiers = prefs[src].modifiers |
                 META_VIRTUAL_SHIFT_MASK;
               (*bindings_p)[dest].mask = 0;
-              (*bindings_p)[dest].keycode = 0;          
+              (*bindings_p)[dest].keycode = prefs[src].keycode;
               
               ++dest;
             }
@@ -783,6 +785,7 @@ regrab_window_bindings (MetaDisplay *dis
 static MetaKeyBindingAction
 display_get_keybinding_action (MetaDisplay  *display,
                                unsigned int  keysym,
+                               guint         keycode,
                                unsigned long mask)
 {
   int i;
@@ -791,6 +794,7 @@ display_get_keybinding_action (MetaDispl
   while (i >= 0)
     {
       if (display->screen_bindings[i].keysym == keysym &&
+          display->screen_bindings[i].keycode == keycode &&
           display->screen_bindings[i].mask == mask)
         {
           return meta_prefs_get_keybinding_action (display->screen_bindings[i].name);
@@ -949,9 +953,9 @@ meta_change_keygrab (MetaDisplay *displa
    */
 
   meta_topic (META_DEBUG_KEYBINDINGS,
-              "%s keybinding %s mask 0x%x on 0x%lx\n",
+              "%s keybinding %s keycode %d mask 0x%x on 0x%lx\n",
               grab ? "Grabbing" : "Ungrabbing",
-              keysym_name (keysym),
+              keysym_name (keysym), keycode,
               modmask, xwindow);
 
   /* efficiency, avoid so many XSync() */
@@ -2402,6 +2406,7 @@ process_tab_grab (MetaDisplay *display,
 
   action = display_get_keybinding_action (display,
                                           keysym,
+                                          event->xkey.keycode,
                                           display->grab_mask);
 
   /* FIXME weird side effect here is that you can use the Escape
@@ -2768,6 +2773,7 @@ process_workspace_switch_grab (MetaDispl
 
       action = display_get_keybinding_action (display,
                                               keysym,
+                                              event->xkey.keycode,
                                               display->grab_mask);
 
       switch (action)
--- src/prefs.c	2004/11/04 19:59:50	1.1
+++ src/prefs.c	2004/11/05 00:53:02
@@ -1432,106 +1432,106 @@ meta_prefs_set_num_workspaces (int n_wor
 
 /* Indexes must correspond to MetaKeybindingAction */
 static MetaKeyPref screen_bindings[] = {
-  { META_KEYBINDING_WORKSPACE_1, 0, 0, FALSE },
-  { META_KEYBINDING_WORKSPACE_2, 0, 0, FALSE },
-  { META_KEYBINDING_WORKSPACE_3, 0, 0, FALSE },
-  { META_KEYBINDING_WORKSPACE_4, 0, 0, FALSE },
-  { META_KEYBINDING_WORKSPACE_5, 0, 0, FALSE },
-  { META_KEYBINDING_WORKSPACE_6, 0, 0, FALSE },
-  { META_KEYBINDING_WORKSPACE_7, 0, 0, FALSE },
-  { META_KEYBINDING_WORKSPACE_8, 0, 0, FALSE }, 
-  { META_KEYBINDING_WORKSPACE_9, 0, 0, FALSE },
-  { META_KEYBINDING_WORKSPACE_10, 0, 0, FALSE },
-  { META_KEYBINDING_WORKSPACE_11, 0, 0, FALSE },
-  { META_KEYBINDING_WORKSPACE_12, 0, 0, FALSE },
-  { META_KEYBINDING_WORKSPACE_LEFT, 0, 0, FALSE },
-  { META_KEYBINDING_WORKSPACE_RIGHT, 0, 0, FALSE },
-  { META_KEYBINDING_WORKSPACE_UP, 0, 0, FALSE },
-  { META_KEYBINDING_WORKSPACE_DOWN, 0, 0, FALSE },
-  { META_KEYBINDING_SWITCH_WINDOWS, 0, 0, TRUE },
-  { META_KEYBINDING_SWITCH_WINDOWS_BACKWARD, 0, 0, TRUE },
-  { META_KEYBINDING_SWITCH_PANELS, 0, 0, TRUE },
-  { META_KEYBINDING_SWITCH_PANELS_BACKWARD, 0, 0, TRUE },
-  { META_KEYBINDING_CYCLE_WINDOWS, 0, 0, TRUE },
-  { META_KEYBINDING_CYCLE_WINDOWS_BACKWARD, 0, 0, TRUE },
-  { META_KEYBINDING_CYCLE_PANELS, 0, 0, TRUE },
-  { META_KEYBINDING_CYCLE_PANELS_BACKWARD, 0, 0, TRUE },
-  { META_KEYBINDING_SHOW_DESKTOP, 0, 0, FALSE },
-  { META_KEYBINDING_PANEL_MAIN_MENU, 0, 0, FALSE },
-  { META_KEYBINDING_PANEL_RUN_DIALOG, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_1, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_2, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_3, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_4, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_5, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_6, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_7, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_8, 0, 0, FALSE }, 
-  { META_KEYBINDING_COMMAND_9, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_10, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_11, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_12, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_13, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_14, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_15, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_16, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_17, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_18, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_19, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_20, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_21, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_22, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_23, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_24, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_25, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_26, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_27, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_28, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_29, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_30, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_31, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_32, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_SCREENSHOT, 0, 0, FALSE },
-  { META_KEYBINDING_COMMAND_WIN_SCREENSHOT, 0, 0, FALSE },
-  { META_KEYBINDING_RUN_COMMAND_TERMINAL, 0, 0, FALSE },
-  { NULL, 0, 0, FALSE}
+  { META_KEYBINDING_WORKSPACE_1, 0, 0, 0, FALSE },
+  { META_KEYBINDING_WORKSPACE_2, 0, 0, 0, FALSE },
+  { META_KEYBINDING_WORKSPACE_3, 0, 0, 0, FALSE },
+  { META_KEYBINDING_WORKSPACE_4, 0, 0, 0, FALSE },
+  { META_KEYBINDING_WORKSPACE_5, 0, 0, 0, FALSE },
+  { META_KEYBINDING_WORKSPACE_6, 0, 0, 0, FALSE },
+  { META_KEYBINDING_WORKSPACE_7, 0, 0, 0, FALSE },
+  { META_KEYBINDING_WORKSPACE_8, 0, 0, 0, FALSE }, 
+  { META_KEYBINDING_WORKSPACE_9, 0, 0, 0, FALSE },
+  { META_KEYBINDING_WORKSPACE_10, 0, 0, 0, FALSE },
+  { META_KEYBINDING_WORKSPACE_11, 0, 0, 0, FALSE },
+  { META_KEYBINDING_WORKSPACE_12, 0, 0, 0, FALSE },
+  { META_KEYBINDING_WORKSPACE_LEFT, 0, 0, 0, FALSE },
+  { META_KEYBINDING_WORKSPACE_RIGHT, 0, 0, 0, FALSE },
+  { META_KEYBINDING_WORKSPACE_UP, 0, 0, 0, FALSE },
+  { META_KEYBINDING_WORKSPACE_DOWN, 0, 0, 0, FALSE },
+  { META_KEYBINDING_SWITCH_WINDOWS, 0, 0, 0, TRUE },
+  { META_KEYBINDING_SWITCH_WINDOWS_BACKWARD, 0, 0, 0, TRUE },
+  { META_KEYBINDING_SWITCH_PANELS, 0, 0, 0, TRUE },
+  { META_KEYBINDING_SWITCH_PANELS_BACKWARD, 0, 0, 0, TRUE },
+  { META_KEYBINDING_CYCLE_WINDOWS, 0, 0, 0, TRUE },
+  { META_KEYBINDING_CYCLE_WINDOWS_BACKWARD, 0, 0, 0, TRUE },
+  { META_KEYBINDING_CYCLE_PANELS, 0, 0, 0, TRUE },
+  { META_KEYBINDING_CYCLE_PANELS_BACKWARD, 0, 0, 0, TRUE },
+  { META_KEYBINDING_SHOW_DESKTOP, 0, 0, 0, FALSE },
+  { META_KEYBINDING_PANEL_MAIN_MENU, 0, 0, 0, FALSE },
+  { META_KEYBINDING_PANEL_RUN_DIALOG, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_1, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_2, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_3, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_4, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_5, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_6, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_7, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_8, 0, 0, 0, FALSE }, 
+  { META_KEYBINDING_COMMAND_9, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_10, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_11, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_12, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_13, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_14, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_15, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_16, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_17, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_18, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_19, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_20, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_21, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_22, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_23, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_24, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_25, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_26, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_27, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_28, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_29, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_30, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_31, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_32, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_SCREENSHOT, 0, 0, 0, FALSE },
+  { META_KEYBINDING_COMMAND_WIN_SCREENSHOT, 0, 0, 0, FALSE },
+  { META_KEYBINDING_RUN_COMMAND_TERMINAL, 0, 0, 0, FALSE },
+  { NULL, 0, 0, 0, FALSE}
 };
 
 static MetaKeyPref window_bindings[] = {
-  { META_KEYBINDING_WINDOW_MENU, 0, 0, FALSE },
-  { META_KEYBINDING_TOGGLE_FULLSCREEN, 0, 0, FALSE },
-  { META_KEYBINDING_TOGGLE_MAXIMIZE, 0, 0, FALSE },
-  { META_KEYBINDING_TOGGLE_ABOVE, 0, 0, FALSE },
-  { META_KEYBINDING_MAXIMIZE, 0, 0, FALSE },
-  { META_KEYBINDING_UNMAXIMIZE, 0, 0, FALSE },
-  { META_KEYBINDING_TOGGLE_SHADE, 0, 0, FALSE },
-  { META_KEYBINDING_MINIMIZE, 0, 0, FALSE },
-  { META_KEYBINDING_CLOSE, 0, 0, FALSE },
-  { META_KEYBINDING_BEGIN_MOVE, 0, 0, FALSE },
-  { META_KEYBINDING_BEGIN_RESIZE, 0, 0, FALSE },
-  { META_KEYBINDING_TOGGLE_STICKY, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_1, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_2, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_3, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_4, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_5, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_6, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_7, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_8, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_9, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_10, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_11, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_12, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_LEFT, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_RIGHT, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_UP, 0, 0, FALSE },
-  { META_KEYBINDING_MOVE_WORKSPACE_DOWN, 0, 0, FALSE },
-  { META_KEYBINDING_RAISE_OR_LOWER, 0, 0, FALSE },
-  { META_KEYBINDING_RAISE, 0, 0, FALSE },
-  { META_KEYBINDING_LOWER, 0, 0, FALSE },
-  { META_KEYBINDING_MAXIMIZE_VERTICALLY, 0, 0, FALSE },
-  { META_KEYBINDING_MAXIMIZE_HORIZONTALLY, 0, 0, FALSE },
-  { NULL, 0, 0, FALSE }
+  { META_KEYBINDING_WINDOW_MENU, 0, 0, 0, FALSE },
+  { META_KEYBINDING_TOGGLE_FULLSCREEN, 0, 0, 0, FALSE },
+  { META_KEYBINDING_TOGGLE_MAXIMIZE, 0, 0, 0, FALSE },
+  { META_KEYBINDING_TOGGLE_ABOVE, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MAXIMIZE, 0, 0, 0, FALSE },
+  { META_KEYBINDING_UNMAXIMIZE, 0, 0, 0, FALSE },
+  { META_KEYBINDING_TOGGLE_SHADE, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MINIMIZE, 0, 0, 0, FALSE },
+  { META_KEYBINDING_CLOSE, 0, 0, 0, FALSE },
+  { META_KEYBINDING_BEGIN_MOVE, 0, 0, 0, FALSE },
+  { META_KEYBINDING_BEGIN_RESIZE, 0, 0, 0, FALSE },
+  { META_KEYBINDING_TOGGLE_STICKY, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_1, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_2, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_3, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_4, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_5, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_6, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_7, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_8, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_9, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_10, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_11, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_12, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_LEFT, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_RIGHT, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_UP, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MOVE_WORKSPACE_DOWN, 0, 0, 0, FALSE },
+  { META_KEYBINDING_RAISE_OR_LOWER, 0, 0, 0, FALSE },
+  { META_KEYBINDING_RAISE, 0, 0, 0, FALSE },
+  { META_KEYBINDING_LOWER, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MAXIMIZE_VERTICALLY, 0, 0, 0, FALSE },
+  { META_KEYBINDING_MAXIMIZE_HORIZONTALLY, 0, 0, 0, FALSE },
+  { NULL, 0, 0, 0, FALSE }
 };
 
 static void
@@ -1651,6 +1651,7 @@ update_binding (MetaKeyPref *binding,
                 const char  *value)
 {
   unsigned int keysym;
+  guint keycode;
   MetaVirtualModifier mods;
   gboolean changed;
   
@@ -1659,10 +1660,11 @@ update_binding (MetaKeyPref *binding,
               binding->name, value ? value : "none");
   
   keysym = 0;
+  keycode = 0;
   mods = 0;
   if (value)
     {
-      if (!meta_ui_parse_accelerator (value, &keysym, &mods))
+      if (!meta_ui_parse_accelerator (value, &keysym, &keycode, &mods))
         {
           meta_topic (META_DEBUG_KEYBINDINGS,
                       "Failed to parse new gconf value\n");
@@ -1673,16 +1675,19 @@ update_binding (MetaKeyPref *binding,
   
   changed = FALSE;
   if (keysym != binding->keysym ||
+      keycode != binding->keycode ||
       mods != binding->modifiers)
     {
       changed = TRUE;
       
       binding->keysym = keysym;
+      binding->keycode = keycode;
       binding->modifiers = mods;
       
       meta_topic (META_DEBUG_KEYBINDINGS,
-                  "New keybinding for \"%s\" is keysym = 0x%x mods = 0x%x\n",
-                  binding->name, binding->keysym, binding->modifiers);
+                  "New keybinding for \"%s\" is keysym = 0x%x keycode = 0x%x mods = 0x%x\n",
+                  binding->name, binding->keysym, binding->keycode, 
+		  binding->modifiers);
     }
   else
     {
--- src/prefs.h	2004/11/04 19:59:30	1.1
+++ src/prefs.h	2004/11/04 20:03:14
@@ -236,6 +236,7 @@ typedef struct
 {
   const char   *name;
   unsigned int  keysym;
+  guint         keycode;
   MetaVirtualModifier modifiers;
   /* for keybindings that can have shift or not like Alt+Tab */
   gboolean      add_shift;
--- src/ui.c	2004/11/04 19:46:18	1.1
+++ src/ui.c	2004/11/04 20:42:00
@@ -742,6 +742,7 @@ meta_ui_have_a_theme (void)
 gboolean
 meta_ui_parse_accelerator (const char          *accel,
                            unsigned int        *keysym,
+                           guint               *keycode,
                            MetaVirtualModifier *mask)
 {
   EggVirtualModifierType gdk_mask = 0;
@@ -753,10 +754,10 @@ meta_ui_parse_accelerator (const char   
   if (strcmp (accel, "disabled") == 0)
     return TRUE;
   
-  if (!egg_accelerator_parse_virtual (accel, &gdk_sym, &gdk_mask))
+  if (!egg_accelerator_parse_virtual (accel, &gdk_sym, keycode, &gdk_mask))
     return FALSE;
 
-  if (gdk_sym == None)
+  if (gdk_sym == None && keycode == 0)
     return FALSE;
   
   if (gdk_mask & EGG_VIRTUAL_RELEASE_MASK) /* we don't allow this */
@@ -794,13 +795,14 @@ meta_ui_parse_modifier (const char      
 {
   EggVirtualModifierType gdk_mask = 0;
   guint gdk_sym = 0;
+  guint keycode;
   
   *mask = 0;
 
   if (strcmp (accel, "disabled") == 0)
     return TRUE;
   
-  if (!egg_accelerator_parse_virtual (accel, &gdk_sym, &gdk_mask))
+  if (!egg_accelerator_parse_virtual (accel, &gdk_sym, &keycode, &gdk_mask))
     return FALSE;
 
   if (gdk_sym != None)
--- src/ui.h	2004/11/04 19:50:19	1.1
+++ src/ui.h	2004/11/04 20:16:00
@@ -181,6 +181,7 @@ gboolean meta_ui_have_a_theme      (void
 
 gboolean meta_ui_parse_accelerator (const char          *accel,
                                     unsigned int        *keysym,
+                                    guint               *keycode,
                                     MetaVirtualModifier *mask);
 gboolean meta_ui_parse_modifier    (const char          *accel,
                                     MetaVirtualModifier *mask);
