diff --git a/atKeynames.js b/atKeynames.js
index e1e27fd..db17ea7 100644
--- a/atKeynames.js
+++ b/atKeynames.js
@@ -17,6 +17,7 @@
    You should have received a copy of the GNU Lesser General Public License
    along with spice-html5.  If not, see <http://www.gnu.org/licenses/>.
 */
+
 /*
  * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
  *
@@ -28,156 +29,174 @@
  * advertising or publicity pertaining to distribution of the software without
  * specific, written prior permission.  Thomas Roell makes no representations
  * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * Copyright (c) 1994-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
+ * as is without express or implied warranty.
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
  *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
  */
 
 /*
- * NOTE: The AT/MF keyboards can generate (via the 8042) two (MF: three)
- *       sets of scancodes. Set3 can only be generated by a MF keyboard.
- *       Set2 sends a makecode for keypress, and the same code prefixed by a
- *       F0 for keyrelease. This is a little bit ugly to handle. Thus we use
- *       here for X386 the PC/XT compatible Set1. This set uses 8bit scancodes.
- *       Bit 7 ist set if the key is released. The code E0 switches to a
- *       different meaning to add the new MF cursorkeys, while not breaking old
- *       applications. E1 is another special prefix. Since I assume that there
- *       will be further versions of PC/XT scancode compatible keyboards, we
- *       may be in trouble one day.
- *
- * IDEA: 1) Use Set2 on AT84 keyboards and translate it to MF Set3.
- *       2) Use the keyboards native set and translate it to common keysyms.
+  Copyright (c) 1994-2003 by The XFree86 Project, Inc.
+
+  Permission is hereby granted, free of charge, to any person obtaining a
+  copy of this software and associated documentation files (the Software),
+  to deal in the Software without restriction, including without limitation
+  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+  and/or sell copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following conditions:
+ 
+  The above copyright notice and this permission notice shall be included in
+  all copies or substantial portions of the Software.
+ 
+  THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+  THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+  OTHER DEALINGS IN THE SOFTWARE.
+ 
+  Except as contained in this notice, the name of the copyright holder(s)
+  and author(s) shall not be used in advertising or otherwise to promote
+  the sale, use or other dealings in this Software without prior written
+  authorization from the copyright holder(s) and author(s).
  */
 
+
+
 /*
- * definition of the AT84/MF101/MF102 Keyboard:
- * ============================================================
- *       Defined             Key Cap Glyphs       Pressed value
- *      Key Name            Main       Also       (hex)    (dec)
- *      ----------------   ---------- -------    ------    ------
+  Definition of the Keyboard AT105:
+  This file maps the Xorg keycodes to Xorg symbols. Please refer to /usr/share/X11/xkb/symbols. 
+  the reason is what ever the face on the key, it's interpreted by Xkb config on Xorg end. 
+  Xspice ignores keyboard config and the only way I found to configure the keyboard 
+  layout is by launching setxkbmap from .xinitrc.
+
+  The symols described in comments (Face Normal/Face +Cap/Face +AltGr) are for reference only and make
+  the debuging easier (for french people...). You should be able to refer any file in 
+  /usr/share/X11/xkb/symbols at the time it maps a PC keyboard. The key codes are retrieved thanks to
+  showkey -k.
+
+  If the user needs to configure keyboard layout, it should use either setxkbmap or any gui tool
+  designed for this purpose under Xorg.
+
+  ====================================================================================
+  Defined              Key      Face                Face                Face
+  Key Name             Code     Normal              +Cap                +AltGr
+  ----------------     -----    -------             ------              -----------
  */
 
-var KEY_Escape      =/* Escape                0x01  */    1
-var KEY_1           =/* 1           !         0x02  */    2
-var KEY_2           =/* 2           @         0x03  */    3
-var KEY_3           =/* 3           #         0x04  */    4
-var KEY_4           =/* 4           $         0x05  */    5
-var KEY_5           =/* 5           %         0x06  */    6
-var KEY_6           =/* 6           ^         0x07  */    7
-var KEY_7           =/* 7           &         0x08  */    8
-var KEY_8           =/* 8           *         0x09  */    9
-var KEY_9           =/* 9           (         0x0a  */   10
-var KEY_0           =/* 0           )         0x0b  */   11
-var KEY_Minus       =/* - (Minus)   _ (Under) 0x0c  */   12
-var KEY_Equal       =/* = (Equal)   +         0x0d  */   13
-var KEY_BackSpace   =/* Back Space            0x0e  */   14
-var KEY_Tab         =/* Tab                   0x0f  */   15
-var KEY_Q           =/* Q                     0x10  */   16
-var KEY_W           =/* W                     0x11  */   17
-var KEY_E           =/* E                     0x12  */   18
-var KEY_R           =/* R                     0x13  */   19
-var KEY_T           =/* T                     0x14  */   20
-var KEY_Y           =/* Y                     0x15  */   21
-var KEY_U           =/* U                     0x16  */   22
-var KEY_I           =/* I                     0x17  */   23
-var KEY_O           =/* O                     0x18  */   24
-var KEY_P           =/* P                     0x19  */   25
-var KEY_LBrace      =/* [           {         0x1a  */   26
-var KEY_RBrace      =/* ]           }         0x1b  */   27
-var KEY_Enter       =/* Enter                 0x1c  */   28
-var KEY_LCtrl       =/* Ctrl(left)            0x1d  */   29
-var KEY_A           =/* A                     0x1e  */   30
-var KEY_S           =/* S                     0x1f  */   31
-var KEY_D           =/* D                     0x20  */   32
-var KEY_F           =/* F                     0x21  */   33
-var KEY_G           =/* G                     0x22  */   34
-var KEY_H           =/* H                     0x23  */   35
-var KEY_J           =/* J                     0x24  */   36
-var KEY_K           =/* K                     0x25  */   37
-var KEY_L           =/* L                     0x26  */   38
-var KEY_SemiColon   =/* ;(SemiColon) :(Colon) 0x27  */   39
-var KEY_Quote       =/* ' (Apostr)  " (Quote) 0x28  */   40
-var KEY_Tilde       =/* ` (Accent)  ~ (Tilde) 0x29  */   41
-var KEY_ShiftL      =/* Shift(left)           0x2a  */   42
-var KEY_BSlash      =/* \(BckSlash) |(VertBar)0x2b  */   43
-var KEY_Z           =/* Z                     0x2c  */   44
-var KEY_X           =/* X                     0x2d  */   45
-var KEY_C           =/* C                     0x2e  */   46
-var KEY_V           =/* V                     0x2f  */   47
-var KEY_B           =/* B                     0x30  */   48
-var KEY_N           =/* N                     0x31  */   49
-var KEY_M           =/* M                     0x32  */   50
-var KEY_Comma       =/* , (Comma)   < (Less)  0x33  */   51
-var KEY_Period      =/* . (Period)  >(Greater)0x34  */   52
-var KEY_Slash       =/* / (Slash)   ?         0x35  */   53
-var KEY_ShiftR      =/* Shift(right)          0x36  */   54
-var KEY_KP_Multiply =/* *                     0x37  */   55
-var KEY_Alt         =/* Alt(left)             0x38  */   56
-var KEY_Space       =/*   (SpaceBar)          0x39  */   57
-var KEY_CapsLock    =/* CapsLock              0x3a  */   58
-var KEY_F1          =/* F1                    0x3b  */   59
-var KEY_F2          =/* F2                    0x3c  */   60
-var KEY_F3          =/* F3                    0x3d  */   61
-var KEY_F4          =/* F4                    0x3e  */   62
-var KEY_F5          =/* F5                    0x3f  */   63
-var KEY_F6          =/* F6                    0x40  */   64
-var KEY_F7          =/* F7                    0x41  */   65
-var KEY_F8          =/* F8                    0x42  */   66
-var KEY_F9          =/* F9                    0x43  */   67
-var KEY_F10         =/* F10                   0x44  */   68
-var KEY_NumLock     =/* NumLock               0x45  */   69
-var KEY_ScrollLock  =/* ScrollLock            0x46  */   70
-var KEY_KP_7        =/* 7           Home      0x47  */   71
-var KEY_KP_8        =/* 8           Up        0x48  */   72
-var KEY_KP_9        =/* 9           PgUp      0x49  */   73
-var KEY_KP_Minus    =/* - (Minus)             0x4a  */   74
-var KEY_KP_4        =/* 4           Left      0x4b  */   75
-var KEY_KP_5        =/* 5                     0x4c  */   76
-var KEY_KP_6        =/* 6           Right     0x4d  */   77
-var KEY_KP_Plus     =/* + (Plus)              0x4e  */   78
-var KEY_KP_1        =/* 1           End       0x4f  */   79
-var KEY_KP_2        =/* 2           Down      0x50  */   80
-var KEY_KP_3        =/* 3           PgDown    0x51  */   81
-var KEY_KP_0        =/* 0           Insert    0x52  */   82
-var KEY_KP_Decimal  =/* . (Decimal) Delete    0x53  */   83
-var KEY_SysReqest   =/* SysReqest             0x54  */   84
-                         /* NOTUSED               0x55  */
-var KEY_Less        =/* < (Less)   >(Greater) 0x56  */   86
-var KEY_F11         =/* F11                   0x57  */   87
-var KEY_F12         =/* F12                   0x58  */   88
+var KEY_ESCAPE          = 1    /*Escape              Escape              Escape              */
+var KEY_AE01            = 2    /*ampersand           one                 dead_acute          */
+var KEY_AE02            = 3    /*eacute              two                 asciitilde          */
+var KEY_AE03            = 4    /*quotedbl            three               numbersign          */
+var KEY_AE04            = 5    /*apostrophe          four                braceleft           */
+var KEY_AE05            = 6    /*parenleft           five                bracketleft         */
+var KEY_AE06            = 7    /*minus               six                 bar                 */
+var KEY_AE07            = 8    /*egrave              seven               dead_grave          */
+var KEY_AE08            = 9    /*underscore          eight               backslash           */
+var KEY_AE09            = 10   /*ccedilla            nine                asciicircum         */
+var KEY_AE10            = 11   /*agrave              zero                at                  */
+var KEY_AE11            = 12   /*parenright                                                  */
+var KEY_AE12            = 13   /*equal               plus                braceright          */
+var KEY_DELETE          = 14   /*Delete              Delete              Delete              */
+var KEY_TAB             = 15   /*Tab                 Tab                 Tab                 */
+var KEY_AD01            = 16   /*a                   A                   acircumflex         */
+var KEY_AD02            = 17   /*z                   Z                   aring               */
+var KEY_AD03            = 18   /*e                   E                                       */
+var KEY_AD04            = 19   /*r                   R                   ccedilla            */
+var KEY_AD05            = 20   /*t                   T                   thorn               */
+var KEY_AD06            = 21   /*y                   Y                   yacute              */
+var KEY_AD07            = 22   /*u                   U                   ucircumflex         */
+var KEY_AD08            = 23   /*i                   I                   icircumflex         */
+var KEY_AD09            = 24   /*o                   O                   ocircumflex         */
+var KEY_AD10            = 25   /*p                   P                                       */
+var KEY_AD11            = 26   /*dead_circumflex     dead_diaeresis      dead_tilde          */
+var KEY_AD12            = 27   /*dollar                                                      */
+var KEY_RETURN          = 28   /*Return              Return              Return              */
+var KEY_CONTROL         = 29   /*Control             Control             Control             */
+var KEY_AC01            = 30   /*q                   Q                   Acircumflex         */
+var KEY_AC02            = 31   /*s                   S                   oslash              */
+var KEY_AC03            = 32   /*d                   D                   Ecircumflex         */
+var KEY_AC04            = 33   /*f                   F                                       */
+var KEY_AC05            = 34   /*g                   G                   ae                  */
+var KEY_AC06            = 35   /*h                   H                   eth                 */
+var KEY_AC07            = 36   /*j                   J                   Ucircumflex         */
+var KEY_AC08            = 37   /*k                   K                   Icircumflex         */
+var KEY_AC09            = 38   /*l                   L                   Ocircumflex         */
+var KEY_AC10            = 39   /*m                   M                                       */
+var KEY_AC11            = 40   /*ugrave              percent                                 */
+var KEY_TLDE		= 41   /*twosuperior,        threesuperior,      onesuperior,  dead_cedilla*/
+var KEY_SHIFT           = 42   /*Shift               Shift               Shift               */
+var KEY_BKSL            = 43   /*asterisk            mu                                      */
+var KEY_AB01            = 44   /*w                   W                                       */
+var KEY_AB02            = 45   /*x                   X                                       */
+var KEY_AB03            = 46   /*c                   C                                       */
+var KEY_AB04            = 47   /*v                   V                                       */
+var KEY_AB05            = 48   /*b                   B                   ssharp              */
+var KEY_AB06            = 49   /*n                   N                                       */
+var KEY_AB07            = 50   /*comma               question                                */
+var KEY_AB08            = 51   /*semicolon           period                                  */
+var KEY_AB09            = 52   /*colon               slash                                   */
+var KEY_AB10            = 53   /*exclam                                                      */
+var KEY_SHIFT           = 54   /*Shift               Shift               Shift               */
+var KEY_KP_MULTIPLY     = 55   /*KP_Multiply         KP_Multiply         Hex_C               */
+var KEY_ALT             = 56   /*Alt                 Alt                 Alt                 */
+var KEY_SPACE           = 57   /*space               space                                   */
+var KEY_CTRLL_LOCK      = 58   /*CtrlL_Lock          CtrlL_Lock          CtrlL_Lock          */
+var KEY_F1              = 59   /*F1                  F13                 Console_13          */
+var KEY_F2              = 60   /*F2                  F14                 Console_14          */
+var KEY_F3              = 61   /*F3                  F15                 Console_15          */
+var KEY_F4              = 62   /*F4                  F16                 Console_16          */
+var KEY_F5              = 63   /*F5                  F17                 Console_17          */
+var KEY_F6              = 64   /*F6                  F18                 Console_18          */
+var KEY_F7              = 65   /*F7                  F19                 Console_19          */
+var KEY_F8              = 66   /*F8                  F20                 Console_20          */
+var KEY_F9              = 67   /*F9                  F21                 Console_21          */
+var KEY_F10             = 68   /*F10                 F22                 Console_22          */
+var KEY_NUM_LOCK        = 69   /*Num_Lock            Num_Lock            Hex_A               */
+var KEY_SCROLL_LOCK     = 70   /*Scroll_Lock         Show_Memory         Show_Registers      */
+var KEY_KP_7            = 71   /*KP_7                KP_7                Hex_7               */
+var KEY_KP_8            = 72   /*KP_8                KP_8                Hex_8               */
+var KEY_KP_9            = 73   /*KP_9                KP_9                Hex_9               */
+var KEY_KP_SUBTRACT     = 74   /*KP_Subtract         KP_Subtract         Hex_D               */
+var KEY_KP_4            = 75   /*KP_4                KP_4                Hex_4               */
+var KEY_KP_5            = 76   /*KP_5                KP_5                Hex_5               */
+var KEY_KP_6            = 77   /*KP_6                KP_6                Hex_6               */
+var KEY_KP_ADD          = 78   /*KP_Add              KP_Add              Hex_E               */
+var KEY_KP_1            = 79   /*KP_1                KP_1                Hex_1               */
+var KEY_KP_2            = 80   /*KP_2                KP_2                Hex_2               */
+var KEY_KP_3            = 81   /*KP_3                KP_3                Hex_3               */
+var KEY_KP_0            = 82   /*KP_0                KP_0                Hex_0               */
+var KEY_KP_PERIOD       = 83   /*KP_Period           KP_Period           KP_Period           */
+var KEY_LAST_CONSOLE    = 84   /*Last_Console        Last_Console        Last_Console        */
+var KEY_LSGT            = 86   /*less                greater             bar                 */
+var KEY_F11             = 87   /*F11                 F23                 Console_23          */
+var KEY_F12             = 88   /*F12                 F24                 Console_24          */
+var KEY_KP_ENTER        = 96   /*KP_Enter            KP_Enter            Hex_F               */
+var KEY_CONTROL         = 97   /*Control             Control             Control             */
+var KEY_KP_DIVIDE       = 98   /*KP_Divide           KP_Divide           Hex_B               */
+var KEY_                = 99   /*                                                            */
+var KEY_ALTGR           = 100  /*AltGr               AltGr               AltGr               */
+var KEY_BREAK           = 101  /*Break               Break               Break               */
+var KEY_FIND            = 102  /*Find                Find                Find                */
+var KEY_UP              = 103  /*Up                  Up                  Up                  */
+var KEY_PRIOR           = 104  /*Prior               Scroll_Backward     Prior               */
+var KEY_LEFT            = 105  /*Left                Left                Left                */
+var KEY_RIGHT           = 106  /*Right               Right               Right               */
+var KEY_SELECT          = 107  /*Select              Select              Select              */
+var KEY_DOWN            = 108  /*Down                Down                Down                */
+var KEY_NEXT            = 109  /*Next                Scroll_Forward      Next                */
+var KEY_INSERT          = 110  /*Insert              Insert              Insert              */
+var KEY_REMOVE          = 111  /*Remove              Remove              Remove              */
+var KEY_MACRO           = 112  /*Macro               Macro               Macro               */
+var KEY_F13             = 113  /*F13                 F13                 F13                 */
+var KEY_F14             = 114  /*F14                 F14                 F14                 */
+var KEY_HELP            = 115  /*Help                Help                Help                */
+var KEY_DO              = 116  /*Do                  Do                  Do                  */
+var KEY_F17             = 117  /*F17                 F17                 F17                 */
+var KEY_KP_MINPLUS      = 118  /*KP_MinPlus          KP_MinPlus          KP_MinPlus          */
+var KEY_PAUSE           = 119  /*Pause               Pause               Pause               */
+var KEY_KP_PERIOD       = 121  /*KP_Period           KP_Period           KP_Period           */
+var KEY_LWIN            = 125  /*LWIN                 Alt                 Alt                */
+var KEY_RWIN            = 126  /*RWIN                 Alt                 Alt                */
+var KEY_MENU            = 127  /*Menu                Menu                Menu                */
 
-var KEY_Prefix0     =/* special               0x60  */   96
-var KEY_Prefix1     =/* specail               0x61  */   97
diff --git a/inputs.js b/inputs.js
index 29f4970..b7af6b1 100644
--- a/inputs.js
+++ b/inputs.js
@@ -190,8 +190,8 @@ function sendCtrlAltDel()
         var key = new SpiceMsgcKeyDown();
         var msg = new SpiceMiniData();
 
-        update_modifier(true, KEY_LCtrl, sc);
-        update_modifier(true, KEY_Alt, sc);
+        update_modifier(true, KEY_CONTROL, sc);
+        update_modifier(true, KEY_ALT, sc);
 
         key.code = KEY_KP_Decimal;
         msg.build_msg(SPICE_MSGC_INPUTS_KEY_DOWN, key);
@@ -199,8 +199,8 @@ function sendCtrlAltDel()
         msg.build_msg(SPICE_MSGC_INPUTS_KEY_UP, key);
         sc.inputs.send_msg(msg);
 
-        if(Ctrl_state == false) update_modifier(false, KEY_LCtrl, sc);
-        if(Alt_state == false) update_modifier(false, KEY_Alt, sc);
+        if(Ctrl_state == false) update_modifier(false, KEY_CONTROL, sc);
+        if(Alt_state == false) update_modifier(false, KEY_ALT, sc);
     }
 }
 
@@ -233,19 +233,19 @@ function check_and_update_modifiers(e, code, sc)
         Meta_state = e.metaKey;
     }
 
-    if (code === KEY_ShiftL)
+    if (code === KEY_SHIFT)
         Shift_state = true;
-    else if (code === KEY_Alt)
+    else if (code === KEY_ALT)
         Alt_state = true;
-    else if (code === KEY_LCtrl)
+    else if (code === KEY_CONTROL)
         Ctrl_state = true;
     else if (code === 0xE0B5)
         Meta_state = true;
-    else if (code === (0x80|KEY_ShiftL))
+    else if (code === (0x80|KEY_SHIFT))
         Shift_state = false;
-    else if (code === (0x80|KEY_Alt))
+    else if (code === (0x80|KEY_ALT))
         Alt_state = false;
-    else if (code === (0x80|KEY_LCtrl))
+    else if (code === (0x80|KEY_CONTROL))
         Ctrl_state = false;
     else if (code === (0x80|0xE0B5))
         Meta_state = false;
@@ -255,19 +255,19 @@ function check_and_update_modifiers(e, code, sc)
         if (Shift_state != e.shiftKey)
         {
             console.log("Shift state out of sync");
-            update_modifier(e.shiftKey, KEY_ShiftL, sc);
+            update_modifier(e.shiftKey, KEY_SHIFT, sc);
             Shift_state = e.shiftKey;
         }
         if (Alt_state != e.altKey)
         {
             console.log("Alt state out of sync");
-            update_modifier(e.altKey, KEY_Alt, sc);
+            update_modifier(e.altKey, KEY_ALT, sc);
             Alt_state = e.altKey;
         }
         if (Ctrl_state != e.ctrlKey)
         {
             console.log("Ctrl state out of sync");
-            update_modifier(e.ctrlKey, KEY_LCtrl, sc);
+            update_modifier(e.ctrlKey, KEY_CONTROL, sc);
             Ctrl_state = e.ctrlKey;
         }
         if (Meta_state != e.metaKey)
diff --git a/spice.html b/spice.html
index f2f9ed0..4a10bd5 100644
--- a/spice.html
+++ b/spice.html
@@ -69,10 +69,11 @@
 
             function connect()
             {
-                var host, port, password, scheme = "ws://", uri;
+                var host, port, path, password, scheme = "wss://", uri;
 
                 host = document.getElementById("host").value; 
-                port = document.getElementById("port").value; 
+                port = document.getElementById("port").value;
+                path = document.getElementById("path").value;
                 password = document.getElementById("password").value;
 
 
@@ -85,7 +86,7 @@
                     sc.stop();
                 }
 
-                uri = scheme + host + ":" + port;
+                uri = scheme + host + ":" + port + "/" + path;
 
                 document.getElementById('connectButton').innerHTML = "Stop";
                 document.getElementById('connectButton').onclick = disconnect;
@@ -152,6 +153,7 @@
             <span class="logo">SPICE</span>
             <label for="host">Host:</label> <input type='text' id='host' value='localhost'> <!-- localhost -->
             <label for="port">Port:</label> <input type='text' id='port' value='5959'>
+            <label for="path">Path:</label> <input type='text' id='path' value='/'>
             <label for="password">Password:</label> <input type='password' id='password' value=''>
             <button id="connectButton" onclick="connect();">Start</button>
         </div>
diff --git a/utils.js b/utils.js
index 9eb42ff..987b29f 100644
--- a/utils.js
+++ b/utils.js
@@ -98,146 +98,146 @@ function hexdump_buffer(a)
 }
 
 /*----------------------------------------------------------------------------
-** Converting keycodes to AT scancodes is very hard.
-** luckly there are some resources on the web and in the Xorg driver that help
-** us figure out what browser depenend keycodes match to what scancodes.
+** This table store Xorg key codes (defined in atKeynames.js) to key pressed
+** on the keyboard. Indices are the keycode generated by html5. To retrieve 
+** the key code from html5, uncomment the line console.log("Code: ", code); 
+** below and track your navigator console.
 **
-** This will most likely not work for non US keyboard and browsers other than
-** modern Chrome and FireFox.
+** This has not been tested on browsers other than modern Chrome and FireFox.
+** Best working with FireFox.
+** Not tested with IE or Safari because I don't use them...
 **--------------------------------------------------------------------------*/
 var common_scanmap = [];
-common_scanmap['Q'.charCodeAt(0)]  = KEY_Q;
-common_scanmap['W'.charCodeAt(0)]  = KEY_W;
-common_scanmap['E'.charCodeAt(0)]  = KEY_E;
-common_scanmap['R'.charCodeAt(0)]  = KEY_R;
-common_scanmap['T'.charCodeAt(0)]  = KEY_T;
-common_scanmap['Y'.charCodeAt(0)]  = KEY_Y;
-common_scanmap['U'.charCodeAt(0)]  = KEY_U;
-common_scanmap['I'.charCodeAt(0)]  = KEY_I;
-common_scanmap['O'.charCodeAt(0)]  = KEY_O;
-common_scanmap['P'.charCodeAt(0)]  = KEY_P;
-common_scanmap['A'.charCodeAt(0)]  = KEY_A;
-common_scanmap['S'.charCodeAt(0)]  = KEY_S;
-common_scanmap['D'.charCodeAt(0)]  = KEY_D;
-common_scanmap['F'.charCodeAt(0)]  = KEY_F;
-common_scanmap['G'.charCodeAt(0)]  = KEY_G;
-common_scanmap['H'.charCodeAt(0)]  = KEY_H;
-common_scanmap['J'.charCodeAt(0)]  = KEY_J;
-common_scanmap['K'.charCodeAt(0)]  = KEY_K;
-common_scanmap['L'.charCodeAt(0)]  = KEY_L;
-common_scanmap['Z'.charCodeAt(0)]  = KEY_Z;
-common_scanmap['X'.charCodeAt(0)]  = KEY_X;
-common_scanmap['C'.charCodeAt(0)]  = KEY_C;
-common_scanmap['V'.charCodeAt(0)]  = KEY_V;
-common_scanmap['B'.charCodeAt(0)]  = KEY_B;
-common_scanmap['N'.charCodeAt(0)]  = KEY_N;
-common_scanmap['M'.charCodeAt(0)]  = KEY_M;
-common_scanmap[' '.charCodeAt(0)]  = KEY_Space;
-common_scanmap[13]                 = KEY_Enter;
-common_scanmap[27]                 = KEY_Escape;
-common_scanmap[8]                  = KEY_BackSpace;
-common_scanmap[9]                  = KEY_Tab;
-common_scanmap[16]                 = KEY_ShiftL;
-common_scanmap[17]                 = KEY_LCtrl;
-common_scanmap[18]                 = KEY_Alt;
-common_scanmap[20]                 = KEY_CapsLock;
-common_scanmap[144]                = KEY_NumLock;
-common_scanmap[112]                = KEY_F1;
-common_scanmap[113]                = KEY_F2;
-common_scanmap[114]                = KEY_F3;
-common_scanmap[115]                = KEY_F4;
-common_scanmap[116]                = KEY_F5;
-common_scanmap[117]                = KEY_F6;
-common_scanmap[118]                = KEY_F7;
-common_scanmap[119]                = KEY_F8;
-common_scanmap[120]                = KEY_F9;
-common_scanmap[121]                = KEY_F10;
-common_scanmap[122]                = KEY_F11;
-common_scanmap[123]                = KEY_F12;
+common_scanmap[8]  = KEY_DELETE;
+common_scanmap[9]  = KEY_TAB;
+common_scanmap[13] = KEY_RETURN;
+common_scanmap[16] = KEY_SHIFT;
+common_scanmap[17] = KEY_CONTROL;
+common_scanmap[18] = KEY_ALT;
+common_scanmap[19] = KEY_PAUSE;
+common_scanmap[20] = KEY_CTRLL_LOCK;
+common_scanmap[27] = KEY_ESCAPE;
+common_scanmap[32] = KEY_SPACE;
+common_scanmap[33] = KEY_PRIOR;
+common_scanmap[34] = KEY_NEXT;
+common_scanmap[35] = KEY_SELECT;
+common_scanmap[36] = KEY_FIND;
+common_scanmap[37] = KEY_LEFT;
+common_scanmap[38] = KEY_UP;
+common_scanmap[39] = KEY_RIGHT;
+common_scanmap[40] = KEY_DOWN;
+common_scanmap[45] = KEY_INSERT;
+common_scanmap[46] = KEY_REMOVE;
+common_scanmap[48] = KEY_AE10;
+common_scanmap[49] = KEY_AE01;
+common_scanmap[50] = KEY_AE02;
+common_scanmap[51] = KEY_AE03;
+common_scanmap[52] = KEY_AE04;
+common_scanmap[53] = KEY_AE05;
+common_scanmap[54] = KEY_AE06;
+common_scanmap[55] = KEY_AE07;
+common_scanmap[56] = KEY_AE08;
+common_scanmap[57] = KEY_AE09;
+common_scanmap[58] = KEY_AB09;
+common_scanmap[59] = KEY_AB08;
+
+common_scanmap[60] = KEY_LSGT;
+common_scanmap[61] = KEY_AE12;
+
+common_scanmap[65] = KEY_AD01;
+common_scanmap[66] = KEY_AB05;
+common_scanmap[67] = KEY_AB03;
+common_scanmap[68] = KEY_AC03;
+common_scanmap[69] = KEY_AD03;
+common_scanmap[70] = KEY_AC04;
+common_scanmap[71] = KEY_AC05;
+common_scanmap[72] = KEY_AC06;
+common_scanmap[73] = KEY_AD08;
+common_scanmap[74] = KEY_AC07;
+common_scanmap[75] = KEY_AC08;
+common_scanmap[76] = KEY_AC09;
+common_scanmap[77] = KEY_AC10;
+common_scanmap[78] = KEY_AB06;
+common_scanmap[79] = KEY_AD09;
+common_scanmap[80] = KEY_AD10;
+common_scanmap[81] = KEY_AC01;
+common_scanmap[82] = KEY_AD04;
+common_scanmap[83] = KEY_AC02;
+common_scanmap[84] = KEY_AD05;
+common_scanmap[85] = KEY_AD07;
+common_scanmap[86] = KEY_AB04;
+common_scanmap[87] = KEY_AB01;
+common_scanmap[88] = KEY_AB02;
+common_scanmap[89] = KEY_AD06;
+common_scanmap[90] = KEY_AD02;
+common_scanmap[91] = KEY_LWIN;
+common_scanmap[92] = KEY_RWIN;
+common_scanmap[93] = KEY_MENU;
+common_scanmap[96] = KEY_KP_0;
+common_scanmap[97] = KEY_KP_1;
+common_scanmap[98] = KEY_KP_2;
+common_scanmap[99] = KEY_KP_3;
+common_scanmap[100] = KEY_KP_4;
+common_scanmap[101] = KEY_KP_5;
+common_scanmap[102] = KEY_KP_6;
+common_scanmap[103] = KEY_KP_7;
+common_scanmap[104] = KEY_KP_8;
+common_scanmap[105] = KEY_KP_9;
+common_scanmap[106] = KEY_KP_MULTIPLY;
+common_scanmap[107] = KEY_KP_ADD;
+common_scanmap[109] = KEY_KP_SUBTRACT;
+common_scanmap[110] = KEY_KP_PERIOD;
+common_scanmap[111] = KEY_KP_DIVIDE;
+common_scanmap[112] = KEY_F1;
+common_scanmap[113] = KEY_F2;
+common_scanmap[114] = KEY_F3;
+common_scanmap[115] = KEY_F4;
+mmon_scanmap[116] = KEY_F5;
+common_scanmap[117] = KEY_F6;
+common_scanmap[118] = KEY_F7;
+common_scanmap[119] = KEY_F8;
+common_scanmap[120] = KEY_F9;
+common_scanmap[121] = KEY_F10;
+common_scanmap[122] = KEY_F11;
+common_scanmap[123] = KEY_F12;
+common_scanmap[144] = KEY_NUM_LOCK;
+common_scanmap[145] = KEY_SCROLL_LOCK;
+
+common_scanmap[161] = KEY_AB10;
+common_scanmap[164] = KEY_AD12;
+common_scanmap[165] = KEY_AC11;
+
+common_scanmap[169] = KEY_AE11;
+common_scanmap[170] = KEY_BKSL;
+
+common_scanmap[188] = KEY_AB07;
+
+common_scanmap[225] = KEY_ALTGR;
 
 /* These externded scancodes do not line up with values from atKeynames */
 common_scanmap[42]                 = 99;
-common_scanmap[19]                 = 101;    // Break
-common_scanmap[111]                = 0xE035; // KP_Divide
-common_scanmap[106]                = 0xE037; // KP_Multiply
-common_scanmap[36]                 = 0xE047; // Home
-common_scanmap[38]                 = 0xE048; // Up
-common_scanmap[33]                 = 0xE049; // PgUp
-common_scanmap[37]                 = 0xE04B; // Left
-common_scanmap[39]                 = 0xE04D; // Right
-common_scanmap[35]                 = 0xE04F; // End
-common_scanmap[40]                 = 0xE050; // Down
-common_scanmap[34]                 = 0xE051; // PgDown
-common_scanmap[45]                 = 0xE052; // Insert
-common_scanmap[46]                 = 0xE053; // Delete
 common_scanmap[44]                 = 0x2A37; // Print
 
-/* These are not common between ALL browsers but are between Firefox and DOM3 */
-common_scanmap['1'.charCodeAt(0)]  = KEY_1;
-common_scanmap['2'.charCodeAt(0)]  = KEY_2;
-common_scanmap['3'.charCodeAt(0)]  = KEY_3;
-common_scanmap['4'.charCodeAt(0)]  = KEY_4;
-common_scanmap['5'.charCodeAt(0)]  = KEY_5;
-common_scanmap['6'.charCodeAt(0)]  = KEY_6;
-common_scanmap['7'.charCodeAt(0)]  = KEY_7;
-common_scanmap['8'.charCodeAt(0)]  = KEY_8;
-common_scanmap['9'.charCodeAt(0)]  = KEY_9;
-common_scanmap['0'.charCodeAt(0)]  = KEY_0;
-common_scanmap[145]                = KEY_ScrollLock;
-common_scanmap[103]                = KEY_KP_7;
-common_scanmap[104]                = KEY_KP_8;
-common_scanmap[105]                = KEY_KP_9;
-common_scanmap[100]                = KEY_KP_4;
-common_scanmap[101]                = KEY_KP_5;
-common_scanmap[102]                = KEY_KP_6;
-common_scanmap[107]                = KEY_KP_Plus;
-common_scanmap[97]                 = KEY_KP_1;
-common_scanmap[98]                 = KEY_KP_2;
-common_scanmap[99]                 = KEY_KP_3;
-common_scanmap[96]                 = KEY_KP_0;
-common_scanmap[110]                = KEY_KP_Decimal;
-common_scanmap[191]                = KEY_Slash;
-common_scanmap[190]                = KEY_Period;
-common_scanmap[188]                = KEY_Comma;
-common_scanmap[220]                = KEY_BSlash;
-common_scanmap[192]                = KEY_Tilde;
-common_scanmap[222]                = KEY_Quote;
-common_scanmap[219]                = KEY_LBrace;
-common_scanmap[221]                = KEY_RBrace;
+/* Scancodes reported specificaly by Google Chrome */
+common_scanmap[186] = KEY_AD12;
+common_scanmap[187] = KEY_AE12;
+common_scanmap[190] = KEY_AB08;
+common_scanmap[191] = KEY_AB09;
+common_scanmap[192] = KEY_AC11;
+common_scanmap[219] = KEY_AE11;
+common_scanmap[220] = KEY_BKSL;
+common_scanmap[223] = KEY_AB10;
 
-common_scanmap[91]                 = 0xE05B; //KEY_LMeta
-common_scanmap[92]                 = 0xE05C; //KEY_RMeta
-common_scanmap[93]                 = 0xE05D; //KEY_Menu
+/* Scancodes reported specificatly by Firefox */
+common_scanmap[0]  = KEY_AD11;
 
-/* Firefox/Mozilla codes */
-var firefox_scanmap = [];
-firefox_scanmap[173]                = KEY_Minus;
-firefox_scanmap[109]                = KEY_Minus;
-firefox_scanmap[61]                 = KEY_Equal;
-firefox_scanmap[59]                 = KEY_SemiColon;
-
-/* DOM3 codes */
-var DOM_scanmap = [];
-DOM_scanmap[189]                = KEY_Minus;
-DOM_scanmap[187]                = KEY_Equal;
-DOM_scanmap[186]                = KEY_SemiColon;
-
-function get_scancode(code)
-{
-    if (common_scanmap[code] === undefined)
-    {
-        if (navigator.userAgent.indexOf("Firefox") != -1)
-            return firefox_scanmap[code];
-        else
-            return DOM_scanmap[code];
-    }
-    else
-        return common_scanmap[code];
-}
 
 function keycode_to_start_scan(code)
 {
-    var scancode = get_scancode(code);
+
+    /*console.log("Code: ", code);*/
+
+    var scancode = common_scanmap[code];
     if (scancode === undefined)
     {
         alert('no map for ' + code);
@@ -253,7 +253,7 @@ function keycode_to_start_scan(code)
 
 function keycode_to_end_scan(code)
 {
-    var scancode = get_scancode(code);
+    var scancode = common_scanmap[code];
     if (scancode === undefined)
         return 0;
 
