diff --git a/src/conio/Makefile b/src/conio/Makefile
index 13f6b2b69d32f2a38fff3cffa13246b9094f27e0..47199233d4ed0943f41ec8a1ad09147096769bb4 100644
--- a/src/conio/Makefile
+++ b/src/conio/Makefile
@@ -52,3 +52,6 @@ $(CIOLIB-MT_SHLIB_BUILD): $(OBJS)
 	$**
 	cw32mt.lib
 |
+
+test:
+	$(QUIET)$(CC) $(CFLAGS) $(MT_LDFLAGS) $(CIOLIB-MT_LDFLAGS) $(XPDEV-MT_LDFLAGS) keytest.c $(LDFLAGS) $(CIOLIB-MT_LIBS) $(XPDEV-MT_LIBS)
diff --git a/src/conio/conio.dsp b/src/conio/conio.dsp
index 9bcd1c12ab5ed7434202f43f25a1ea28c84a320d..c7236931b5550bedc58abe850e5f05294c9b99b7 100644
--- a/src/conio/conio.dsp
+++ b/src/conio/conio.dsp
@@ -1,108 +1,108 @@
-# Microsoft Developer Studio Project File - Name="conio" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=conio - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "conio.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "conio.mak" CFG="conio - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "conio - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "conio - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "conio - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "msvc.win32.release"
-# PROP Intermediate_Dir "msvc.win32.release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "..\xpdev" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LINK_LIST_THREADSAFE" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF  "$(CFG)" == "conio - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "msvc.win32.debug"
-# PROP Intermediate_Dir "msvc.win32.debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "." /I "..\xpdev" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LINK_LIST_THREADSAFE" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ENDIF 
-
-# Begin Target
-
-# Name "conio - Win32 Release"
-# Name "conio - Win32 Debug"
-# Begin Source File
-
-SOURCE=.\ansi_cio.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\ciolib.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\cterm.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\mouse.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\vidmodes.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\win32cio.c
-# End Source File
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="conio" - Package Owner=<4>

+# Microsoft Developer Studio Generated Build File, Format Version 6.00

+# ** DO NOT EDIT **

+

+# TARGTYPE "Win32 (x86) Static Library" 0x0104

+

+CFG=conio - Win32 Debug

+!MESSAGE This is not a valid makefile. To build this project using NMAKE,

+!MESSAGE use the Export Makefile command and run

+!MESSAGE 

+!MESSAGE NMAKE /f "conio.mak".

+!MESSAGE 

+!MESSAGE You can specify a configuration when running NMAKE

+!MESSAGE by defining the macro CFG on the command line. For example:

+!MESSAGE 

+!MESSAGE NMAKE /f "conio.mak" CFG="conio - Win32 Debug"

+!MESSAGE 

+!MESSAGE Possible choices for configuration are:

+!MESSAGE 

+!MESSAGE "conio - Win32 Release" (based on "Win32 (x86) Static Library")

+!MESSAGE "conio - Win32 Debug" (based on "Win32 (x86) Static Library")

+!MESSAGE 

+

+# Begin Project

+# PROP AllowPerConfigDependencies 0

+# PROP Scc_ProjName ""

+# PROP Scc_LocalPath ""

+CPP=cl.exe

+RSC=rc.exe

+

+!IF  "$(CFG)" == "conio - Win32 Release"

+

+# PROP BASE Use_MFC 0

+# PROP BASE Use_Debug_Libraries 0

+# PROP BASE Output_Dir "Release"

+# PROP BASE Intermediate_Dir "Release"

+# PROP BASE Target_Dir ""

+# PROP Use_MFC 0

+# PROP Use_Debug_Libraries 0

+# PROP Output_Dir "msvc.win32.release"

+# PROP Intermediate_Dir "msvc.win32.release"

+# PROP Target_Dir ""

+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c

+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "..\xpdev" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LINK_LIST_THREADSAFE" /YX /FD /c

+# ADD BASE RSC /l 0x409 /d "NDEBUG"

+# ADD RSC /l 0x409 /d "NDEBUG"

+BSC32=bscmake.exe

+# ADD BASE BSC32 /nologo

+# ADD BSC32 /nologo

+LIB32=link.exe -lib

+# ADD BASE LIB32 /nologo

+# ADD LIB32 /nologo

+

+!ELSEIF  "$(CFG)" == "conio - Win32 Debug"

+

+# PROP BASE Use_MFC 0

+# PROP BASE Use_Debug_Libraries 1

+# PROP BASE Output_Dir "Debug"

+# PROP BASE Intermediate_Dir "Debug"

+# PROP BASE Target_Dir ""

+# PROP Use_MFC 0

+# PROP Use_Debug_Libraries 1

+# PROP Output_Dir "msvc.win32.debug"

+# PROP Intermediate_Dir "msvc.win32.debug"

+# PROP Target_Dir ""

+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c

+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "." /I "..\xpdev" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LINK_LIST_THREADSAFE" /YX /FD /GZ /c

+# ADD BASE RSC /l 0x409 /d "_DEBUG"

+# ADD RSC /l 0x409 /d "_DEBUG"

+BSC32=bscmake.exe

+# ADD BASE BSC32 /nologo

+# ADD BSC32 /nologo

+LIB32=link.exe -lib

+# ADD BASE LIB32 /nologo

+# ADD LIB32 /nologo

+

+!ENDIF 

+

+# Begin Target

+

+# Name "conio - Win32 Release"

+# Name "conio - Win32 Debug"

+# Begin Source File

+

+SOURCE=.\ansi_cio.c

+# End Source File

+# Begin Source File

+

+SOURCE=.\ciolib.c

+# End Source File

+# Begin Source File

+

+SOURCE=.\cterm.c

+# End Source File

+# Begin Source File

+

+SOURCE=.\mouse.c

+# End Source File

+# Begin Source File

+

+SOURCE=.\vidmodes.c

+# End Source File

+# Begin Source File

+

+SOURCE=.\win32cio.c

+# End Source File

+# End Target

+# End Project

diff --git a/src/conio/win32cio.c b/src/conio/win32cio.c
index 402a94c1c0147d7a9b220024f1b197ff4c4cb71c..5e390aa51702b2e5a973c7545c91b46db32c5bf6 100644
--- a/src/conio/win32cio.c
+++ b/src/conio/win32cio.c
@@ -305,18 +305,21 @@ int win32_keyboardio(int isgetch)
 					,input.Event.KeyEvent.dwControlKeyState); 
 
 				if(input.Event.KeyEvent.bKeyDown) {
-					if((input.Event.KeyEvent.dwControlKeyState & (RIGHT_ALT_PRESSED|LEFT_ALT_PRESSED|RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED|ENHANCED_KEY))
+					/* Is this an AltGr key? */
+					if(((input.Event.KeyEvent.dwControlKeyState & (RIGHT_ALT_PRESSED|LEFT_CTRL_PRESSED)) == (RIGHT_ALT_PRESSED|LEFT_CTRL_PRESSED))
+							&& (BYTE)input.Event.KeyEvent.uChar.AsciiChar) {
+						lastch=(BYTE)input.Event.KeyEvent.uChar.AsciiChar;
+					}
+					/* Is this a modified char? */
+					else if((input.Event.KeyEvent.dwControlKeyState & (RIGHT_ALT_PRESSED|LEFT_ALT_PRESSED|RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED|ENHANCED_KEY))
 							|| (input.Event.KeyEvent.wVirtualKeyCode >= VK_F1 && input.Event.KeyEvent.wVirtualKeyCode <= VK_F24)
-							|| !input.Event.KeyEvent.uChar.AsciiChar
-							|| (!(input.Event.KeyEvent.dwControlKeyState & NUMLOCK_ON) && (input.Event.KeyEvent.uChar.AsciiChar >= '.' && input.Event.KeyEvent.uChar.AsciiChar <= '9')))
-						/* Is this an AltGr key? */
-						if((input.Event.KeyEvent.dwControlKeyState & RIGHT_ALT_PRESSED|LEFT_CTRL_PRESSED == RIGHT_ALT_PRESSED|LEFT_CTRL_PRESSED)
-								&& (BYTE)input.Event.KeyEvent.uChar.AsciiChar)
-							lastch=(BYTE)input.Event.KeyEvent.uChar.AsciiChar;
-						else
-							lastch=win32_getchcode(input.Event.KeyEvent.wVirtualKeyCode, input.Event.KeyEvent.dwControlKeyState);
-					else
+							|| !input.Event.KeyEvent.uChar.AsciiChar) {
+						lastch=win32_getchcode(input.Event.KeyEvent.wVirtualKeyCode, input.Event.KeyEvent.dwControlKeyState);
+					}
+					/* Must be a normal char then! */
+					else {
 						lastch=(BYTE)input.Event.KeyEvent.uChar.AsciiChar;
+					}
 				} else if(input.Event.KeyEvent.wVirtualKeyCode == VK_MENU)
 					lastch=(BYTE)input.Event.KeyEvent.uChar.AsciiChar;