diff --git a/Graphics/X11/Types.hsc b/Graphics/X11/Types.hsc
--- a/Graphics/X11/Types.hsc
+++ b/Graphics/X11/Types.hsc
@@ -826,7 +826,7 @@
 type Colormap = XID
 type GContext = XID
 
-type KeyCode  = Char
+type KeyCode  = #{type KeyCode}
 
 type KeySym   = XID
 
diff --git a/Graphics/X11/Xlib/Cursor.hsc b/Graphics/X11/Xlib/Cursor.hsc
--- a/Graphics/X11/Xlib/Cursor.hsc
+++ b/Graphics/X11/Xlib/Cursor.hsc
@@ -8,7 +8,7 @@
 -- Stability   :  provisional
 -- Portability :  portable
 --
--- A collection of cursor types defined by /usr/include/X11/cursorfont.h.
+-- A collection of cursor types defined by \/usr/include/X11/cursorfont.h.
 --
 -----------------------------------------------------------------------------
 
diff --git a/Graphics/X11/Xlib/Extras.hsc b/Graphics/X11/Xlib/Extras.hsc
--- a/Graphics/X11/Xlib/Extras.hsc
+++ b/Graphics/X11/Xlib/Extras.hsc
@@ -913,8 +913,8 @@
 -}
 
 -- | The XGetWMProtocols function returns the list of atoms
--- stored in the WM_PROTOCOLS property on the specified win­
--- dow.  These atoms describe window manager protocols in
+-- stored in the WM_PROTOCOLS property on the specified window.
+-- These atoms describe window manager protocols in
 -- which the owner of this window is willing to participate.
 -- If the property exists, is of type ATOM, is of format 32,
 -- and the atom WM_PROTOCOLS can be interned, XGetWMProtocols
@@ -1360,24 +1360,6 @@
 foreign import ccall unsafe "XlibExtras.h x11_extras_IsPrivateKeypadKey"
     isPrivateKeypadKey :: KeySym -> Bool
 
--- FIXME: X11 doesn't have a Read instance for Rectangle, so we include one for now.
-{-* Generated by DrIFT : Look, but Don't Touch. *-}
-instance Read Rectangle where
-    readsPrec d input =
-          readParen (d > 9)
-          (\ inp ->
-           [((Rectangle aa ab ac ad) , rest) | ("Rectangle" , inp) <- lex inp
-        , ("{" , inp) <- lex inp , ("rect_x" , inp) <- lex inp ,
-        ("=" , inp) <- lex inp , (aa , inp) <- readsPrec 10 inp ,
-        ("," , inp) <- lex inp , ("rect_y" , inp) <- lex inp ,
-        ("=" , inp) <- lex inp , (ab , inp) <- readsPrec 10 inp ,
-        ("," , inp) <- lex inp , ("rect_width" , inp) <- lex inp ,
-        ("=" , inp) <- lex inp , (ac , inp) <- readsPrec 10 inp ,
-        ("," , inp) <- lex inp , ("rect_height" , inp) <- lex inp ,
-        ("=" , inp) <- lex inp , (ad , inp) <- readsPrec 10 inp ,
-        ("}" , rest) <- lex inp])
-          input
-
 -------------------------------------------------------------------------------
 -- Selections
 --
@@ -1465,3 +1447,21 @@
     texts <- flip mapM [0 .. fromIntegral $ pred argc] $ \i -> peekElemOff argv i >>= peekCWString
     wcFreeStringList argv
     return texts
+
+foreign import ccall unsafe "HsXlib.h XGetModifierMapping"
+    xGetModifierMapping :: Display -> IO (Ptr ())
+
+foreign import ccall unsafe "HsXlib.h XFreeModifiermap"
+    xFreeModifiermap :: Ptr () -> IO (Ptr CInt)
+
+getModifierMapping :: Display -> IO [(Modifier, [KeyCode])]
+getModifierMapping d = do
+    p <- xGetModifierMapping d
+    m' <- #{peek XModifierKeymap, max_keypermod} p :: IO CInt
+    let m = fromIntegral m'
+    pks <- #{peek XModifierKeymap, modifiermap} p :: IO (Ptr KeyCode)
+    ks <- peekArray (m * 8) pks
+    xFreeModifiermap p
+    return . zip masks . map fst . tail . iterate (splitAt m . snd) $ ([], ks)
+ where
+    masks = [shiftMapIndex .. mod5MapIndex]
diff --git a/Graphics/X11/Xlib/Types.hsc b/Graphics/X11/Xlib/Types.hsc
--- a/Graphics/X11/Xlib/Types.hsc
+++ b/Graphics/X11/Xlib/Types.hsc
@@ -15,7 +15,7 @@
 
 -- #hide
 module Graphics.X11.Xlib.Types(
-        Display(..), Screen, Visual, GC, GCValues, SetWindowAttributes,
+        Display(..), Screen(..), Visual, GC, GCValues, SetWindowAttributes,
         Image(..), Point(..), Rectangle(..), Arc(..), Segment(..), Color(..),
         Pixel, Position, Dimension, Angle, ScreenNumber, Buffer
         ) where
@@ -171,9 +171,9 @@
         rect_height :: !Dimension
         }
 #if __GLASGOW_HASKELL__
-        deriving (Eq, Show, Typeable, Data)
+        deriving (Eq, Read, Show, Typeable, Data)
 #else
-        deriving (Eq, Show)
+        deriving (Eq, Read, Show)
 #endif
 
 instance Storable Rectangle where
diff --git a/X11.cabal b/X11.cabal
--- a/X11.cabal
+++ b/X11.cabal
@@ -1,10 +1,10 @@
 name:               X11
-version:            1.4.6.1
+version:            1.5.0.0
 license:            BSD3
 license-file:       LICENSE
-copyright:          Alastair Reid, 1999-2003, libraries@haskell.org 2003-2007, Don Stewart 2007-2009.
-maintainer:         Don Stewart <dons@galois.com>
-homepage:           http://darcs.haskell.org/X11
+copyright:          Alastair Reid, 1999-2003, libraries@haskell.org 2003-2007, Don Stewart 2007-2009, Spencer Janssen 2007-2009.
+maintainer:         Spencer Janssen <spencerjanssen@gmail.com>
+homepage:           http://code.haskell.org/X11
 category:           Graphics
 synopsis:           A binding to the X11 graphics library
 description:        A Haskell binding to the X11 graphics library.
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.64 for Haskell X11 package 1.4.5.
+# Generated by GNU Autoconf 2.64 for Haskell X11 package 1.4.6.
 #
 # Report bugs to <dons@galois.com>.
 #
@@ -549,8 +549,8 @@
 # Identity of this package.
 PACKAGE_NAME='Haskell X11 package'
 PACKAGE_TARNAME='X11'
-PACKAGE_VERSION='1.4.5'
-PACKAGE_STRING='Haskell X11 package 1.4.5'
+PACKAGE_VERSION='1.4.6'
+PACKAGE_STRING='Haskell X11 package 1.4.6'
 PACKAGE_BUGREPORT='dons@galois.com'
 PACKAGE_URL=''
 
@@ -1208,7 +1208,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Haskell X11 package 1.4.5 to adapt to many kinds of systems.
+\`configure' configures Haskell X11 package 1.4.6 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1273,7 +1273,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Haskell X11 package 1.4.5:";;
+     short | recursive ) echo "Configuration of Haskell X11 package 1.4.6:";;
    esac
   cat <<\_ACEOF
 
@@ -1368,7 +1368,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Haskell X11 package configure 1.4.5
+Haskell X11 package configure 1.4.6
 generated by GNU Autoconf 2.64
 
 Copyright (C) 2009 Free Software Foundation, Inc.
@@ -1739,7 +1739,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Haskell X11 package $as_me 1.4.5, which was
+It was created by Haskell X11 package $as_me 1.4.6, which was
 generated by GNU Autoconf 2.64.  Invocation command line was
 
   $ $0 $@
@@ -4703,7 +4703,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Haskell X11 package $as_me 1.4.5, which was
+This file was extended by Haskell X11 package $as_me 1.4.6, which was
 generated by GNU Autoconf 2.64.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -4763,7 +4763,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-Haskell X11 package config.status 1.4.5
+Haskell X11 package config.status 1.4.6
 configured by $0, generated by GNU Autoconf 2.64,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
