Index: trunk/src/user32/Makefile
===================================================================
--- trunk/src/user32/Makefile	(revision 1628)
+++ trunk/src/user32/Makefile	(revision 1629)
@@ -1,3 +1,3 @@
-# $Id: Makefile,v 1.41 1999-11-04 19:00:59 sandervl Exp $
+# $Id: Makefile,v 1.42 1999-11-08 13:44:13 sandervl Exp $
 
 #
@@ -25,6 +25,6 @@
 
 OBJS =  user32.obj loadres.obj \
-        dde.obj win32wndhandle.obj wsprintf.obj \
-        icon.obj hook.obj hooks.obj winmenu.obj \
+        dde.obj win32wndhandle.obj wsprintf.obj winmouse.obj \
+        icon.obj hook.obj hooks.obj winmenu.obj winkeyboard.obj \
         defwndproc.obj syscolor.obj char.obj initterm.obj \
         uitools.obj unknown.obj spy.obj wndmsg.obj \
@@ -83,5 +83,5 @@
 
 user32.obj: user32.cpp $(PDWIN32_INCLUDE)\wndproc.h \
-            $(PDWIN32_INCLUDE)\winicon.h syscolor.h
+            $(PDWIN32_INCLUDE)\winicon.h syscolor.h pmwindow.h
 dummy.obj: dummy.cpp
 char.obj: char.cpp user32.h
@@ -125,5 +125,5 @@
 pmframe.obj: pmframe.cpp win32class.h win32wbase.h pmframe.h win32wndchild.h
 win32class.obj: win32class.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h
-win32wbase.obj:   win32wbase.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h dc.h pmframe.h win32wdesktop.h controls.h
+win32wbase.obj:   win32wbase.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h dc.h pmframe.h win32wdesktop.h controls.h winmouse.h
 win32wbasepos.obj: win32wbasepos.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h dc.h pmframe.h win32wdesktop.h
 win32wnd.obj:   win32wnd.cpp win32class.h win32wbase.h win32wnd.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h oslibmenu.h
@@ -149,4 +149,7 @@
 wsprintf.obj:   wsprintf.cpp
 
+winmouse.obj:   winmouse.cpp winmouse.h oslibmsg.h pmwindow.h win32wbase.h
+winkeyboard.obj: winkeyboard.cpp $(PDWIN32_INCLUDE)\winkeyboard.h
+
 clean:
         $(RM) *.obj *.lib *.dll *.map *.pch *.res
Index: trunk/src/user32/USER32.DEF
===================================================================
--- trunk/src/user32/USER32.DEF	(revision 1628)
+++ trunk/src/user32/USER32.DEF	(revision 1629)
@@ -1,3 +1,3 @@
-; $Id: USER32.DEF,v 1.18 1999-11-03 22:04:21 cbratschi Exp $
+; $Id: USER32.DEF,v 1.19 1999-11-08 13:44:13 sandervl Exp $
 
 ;Created by BLAST for IBM's compiler
@@ -632,2 +632,6 @@
 
     Win32ToOS2Handle__FUl      = Win32ToOS2Handle__15Win32BaseWindowFUl @2006
+
+    _MOUSE_Enable@4                                              @2007
+    _KeyTranslatePMToWin@4                                       @2008
+    _KeyTranslatePMToWinBuf@12                                   @2009
Index: trunk/src/user32/oslibmsg.cpp
===================================================================
--- trunk/src/user32/oslibmsg.cpp	(revision 1628)
+++ trunk/src/user32/oslibmsg.cpp	(revision 1629)
@@ -1,3 +1,3 @@
-/* $Id: oslibmsg.cpp,v 1.8 1999-11-05 12:54:10 sandervl Exp $ */
+/* $Id: oslibmsg.cpp,v 1.9 1999-11-08 13:44:14 sandervl Exp $ */
 /*
  * Window message translation functions for OS/2
@@ -228,2 +228,8 @@
 //******************************************************************************
 //******************************************************************************
+ULONG OSLibWinQueryMsgTime()
+{
+  return WinQueryMsgTime(GetThreadHAB());
+}
+//******************************************************************************
+//******************************************************************************
Index: trunk/src/user32/oslibmsg.h
===================================================================
--- trunk/src/user32/oslibmsg.h	(revision 1628)
+++ trunk/src/user32/oslibmsg.h	(revision 1629)
@@ -1,3 +1,3 @@
-/* $Id: oslibmsg.h,v 1.2 1999-10-20 08:08:31 sandervl Exp $ */
+/* $Id: oslibmsg.h,v 1.3 1999-11-08 13:44:14 sandervl Exp $ */
 /*
  * Window message translation functions for OS/2
@@ -30,4 +30,5 @@
 LONG  OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode = FALSE);
 
+ULONG OSLibWinQueryMsgTime();
 BOOL  OSLibInitMsgQueue();
 
Index: trunk/src/user32/pmwindow.cpp
===================================================================
--- trunk/src/user32/pmwindow.cpp	(revision 1628)
+++ trunk/src/user32/pmwindow.cpp	(revision 1629)
@@ -1,3 +1,3 @@
-/* $Id: pmwindow.cpp,v 1.51 1999-11-03 22:04:22 cbratschi Exp $ */
+/* $Id: pmwindow.cpp,v 1.52 1999-11-08 13:44:14 sandervl Exp $ */
 /*
  * Win32 Window Managment Code for OS/2
@@ -13,5 +13,4 @@
 #define INCL_GPI
 
-#include <os2.h>                        /* PM header file               */
 #include <os2wrap.h>
 #include <stdlib.h>
Index: trunk/src/user32/pmwindow.h
===================================================================
--- trunk/src/user32/pmwindow.h	(revision 1628)
+++ trunk/src/user32/pmwindow.h	(revision 1629)
@@ -1,3 +1,3 @@
-/* $Id: pmwindow.h,v 1.3 1999-10-30 15:16:57 dengert Exp $ */
+/* $Id: pmwindow.h,v 1.4 1999-11-08 13:44:14 sandervl Exp $ */
 /*
  * Win32 Window Managment Code for OS/2
@@ -19,3 +19,6 @@
 void UnregisterSystemClasses();
 
+extern ULONG ScreenWidth;
+extern ULONG ScreenHeight;
+
 #endif
Index: trunk/src/user32/user32.cpp
===================================================================
--- trunk/src/user32/user32.cpp	(revision 1628)
+++ trunk/src/user32/user32.cpp	(revision 1629)
@@ -1,3 +1,3 @@
-/* $Id: user32.cpp,v 1.50 1999-11-04 18:35:42 phaller Exp $ */
+/* $Id: user32.cpp,v 1.51 1999-11-08 13:44:14 sandervl Exp $ */
 
 /*
@@ -33,4 +33,5 @@
 #include <winicon.h>
 #include "syscolor.h"
+#include "pmwindow.h"
 
 #include <wchar.h>
@@ -817,4 +818,10 @@
         rc = 0;
         break;
+    case SM_CXSCREEN:
+
+	return ScreenWidth;
+    case SM_CYSCREEN:
+	return ScreenHeight;
+
     case SM_CXVIRTUALSCREEN:
         rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CXSCREEN);
Index: trunk/src/user32/user32exp.def
===================================================================
--- trunk/src/user32/user32exp.def	(revision 1628)
+++ trunk/src/user32/user32exp.def	(revision 1629)
@@ -578,2 +578,5 @@
     _TrackWin32Window@8                       @2003
     Win32ToOS2Handle__FUl                     @2006
+    _MOUSE_Enable@4                           @2007
+    _KeyTranslatePMToWin@4                    @2008
+    _KeyTranslatePMToWinBuf@12                @2009
Index: trunk/src/user32/win32wbase.cpp
===================================================================
--- trunk/src/user32/win32wbase.cpp	(revision 1628)
+++ trunk/src/user32/win32wbase.cpp	(revision 1629)
@@ -1,3 +1,3 @@
-/* $Id: win32wbase.cpp,v 1.76 1999-11-05 09:16:22 sandervl Exp $ */
+/* $Id: win32wbase.cpp,v 1.77 1999-11-08 13:44:15 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2
@@ -41,4 +41,5 @@
 #include "controls.h"
 #include <wprocess.h>
+#include "winmouse.h"
 
 #define HAS_DLGFRAME(style,exStyle) \
@@ -1033,4 +1034,9 @@
  ULONG win32ncmsg;
  BOOL  fClick = FALSE;
+
+    if(ISMOUSE_CAPTURED()) {
+	if(DInputMouseHandler(getWindowHandle(), MOUSEMSG_BUTTON, ncx, ncy, msg))
+		return 0;
+    }
 
     dprintf(("MsgButton to (%d,%d)", ncx, ncy));
@@ -1147,4 +1153,12 @@
  ULONG setcursormsg = WM_MOUSEMOVE;
 
+    if(ISMOUSE_CAPTURED()) {
+	POINT point = {x,y};
+        
+        MapWindowPoints(getWindowHandle(), HWND_DESKTOP, &point, 1);
+	if(DInputMouseHandler(getWindowHandle(), MOUSEMSG_MOVE, point.x, point.y, keystate))
+		return 0;
+    }
+
     if(keystate & WMMOVE_LBUTTON)
         winstate |= MK_LBUTTON;
Index: trunk/src/user32/windowmsg.cpp
===================================================================
--- trunk/src/user32/windowmsg.cpp	(revision 1628)
+++ trunk/src/user32/windowmsg.cpp	(revision 1629)
@@ -1,3 +1,3 @@
-/* $Id: windowmsg.cpp,v 1.3 1999-10-30 13:21:56 sandervl Exp $ */
+/* $Id: windowmsg.cpp,v 1.4 1999-11-08 13:44:17 sandervl Exp $ */
 /*
  * Win32 window message APIs for OS/2
@@ -207,20 +207,15 @@
 //******************************************************************************
 //******************************************************************************
-BOOL WIN32API PostThreadMessageA( DWORD arg1, UINT arg2, WPARAM arg3, LPARAM  arg4)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  PostThreadMessageA\n");
-#endif
-    return O32_PostThreadMessage(arg1, arg2, arg3, arg4);
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API PostThreadMessageW( DWORD arg1, UINT arg2, WPARAM arg3, LPARAM  arg4)
-{
-#ifdef DEBUG
-    WriteLog("USER32:  PostThreadMessageW\n");
-#endif
-    // NOTE: This will not work as is (needs UNICODE support)
-    return O32_PostThreadMessage(arg1, arg2, arg3, arg4);
+BOOL WIN32API PostThreadMessageA( DWORD threadid, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+    dprintf(("USER32:  PostThreadMessageA\n"));
+    return O32_PostThreadMessage(threadid, WIN32APP_USERMSGBASE+msg, wParam, lParam);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API PostThreadMessageW( DWORD threadid, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+    dprintf(("USER32:  PostThreadMessageW\n"));
+    return O32_PostThreadMessage(threadid, WIN32APP_USERMSGBASE+msg, wParam, lParam);
 }
 //******************************************************************************
Index: trunk/src/user32/winkeyboard.cpp
===================================================================
--- trunk/src/user32/winkeyboard.cpp	(revision 1629)
+++ trunk/src/user32/winkeyboard.cpp	(revision 1629)
@@ -0,0 +1,290 @@
+/* $Id: winkeyboard.cpp,v 1.1 1999-11-08 13:44:40 sandervl Exp $ */
+/*
+ * Win32 <-> PM key translation
+ *
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+#include <os2win.h>
+#include <odin.h>
+#include <winkeyboard.h>
+
+BYTE abPMScanToWinVKey[256] =
+/****************************************************************************/
+/* PM Scancode              *    Win32 vkey                                 */
+/****************************************************************************/
+/* 0x00                     */ { 0x00
+/* 0x01 PMSCAN_ESC          */ , VK_ESCAPE
+/* 0x02 PMSCAN_ONE          */ , VK_1
+/* 0x03 PMSCAN_TWO          */ , VK_2
+/* 0x04 PMSCAN_THREE        */ , VK_3
+/* 0x05 PMSCAN_FOUR         */ , VK_4
+/* 0x06 PMSCAN_FIVE         */ , VK_5
+/* 0x07 PMSCAN_SIX          */ , VK_6
+/* 0x08 PMSCAN_SEVEN        */ , VK_7
+/* 0x09 PMSCAN_EIGHT        */ , VK_8
+/* 0x0A PMSCAN_NINE         */ , VK_9
+/* 0x0B PMSCAN_ZERO         */ , VK_0
+/* 0x0C PMSCAN_HYPHEN       */ , VK_HYPHEN
+/* 0x0D PMSCAN_EQUAL        */ , VK_EQUAL
+/* 0x0E PMSCAN_BACKSPACE    */ , VK_BACK
+/* 0x0F PMSCAN_TAB          */ , VK_TAB
+/* 0x10 PMSCAN_Q            */ , VK_Q
+/* 0x11 PMSCAN_W            */ , VK_W
+/* 0x12 PMSCAN_E            */ , VK_E
+/* 0x13 PMSCAN_R            */ , VK_R
+/* 0x14 PMSCAN_T            */ , VK_T
+/* 0x15 PMSCAN_Y            */ , VK_Y
+/* 0x16 PMSCAN_U            */ , VK_U
+/* 0x17 PMSCAN_I            */ , VK_I
+/* 0x18 PMSCAN_O            */ , VK_O
+/* 0x19 PMSCAN_P            */ , VK_P
+/* 0x1A PMSCAN_BRACKETLEFT  */ , VK_BRACKETLEFT
+/* 0x1B PMSCAN_BRACKETRIGHT */ , VK_BRACKETRIGHT
+/* 0x1C PMSCAN_ENTER        */ , VK_RETURN
+/* 0x1D PMSCAN_CTRLLEFT     */ , VK_CONTROL
+/* 0x1E PMSCAN_A            */ , VK_A
+/* 0x1F PMSCAN_S            */ , VK_S
+/* 0x20 PMSCAN_D            */ , VK_D
+/* 0x21 PMSCAN_F            */ , VK_F
+/* 0x22 PMSCAN_G            */ , VK_G
+/* 0x23 PMSCAN_H            */ , VK_H
+/* 0x24 PMSCAN_J            */ , VK_J
+/* 0x25 PMSCAN_K            */ , VK_K
+/* 0x26 PMSCAN_L            */ , VK_L
+/* 0x27 PMSCAN_SEMICOLON    */ , VK_SEMICOLON
+/* 0x28 PMSCAN_QUOTESINGLE  */ , VK_QUOTESINGLE
+/* 0x29 PMSCAN_GRAVE        */ , VK_GRAVE
+/* 0x2A PMSCAN_SHIFTLEFT    */ , VK_SHIFT
+/* 0x2B PMSCAN_BACKSLASH    */ , VK_BACKSLASH
+/* 0x2C PMSCAN_Z            */ , VK_Z
+/* 0x2D PMSCAN_X            */ , VK_X
+/* 0x2E PMSCAN_C            */ , VK_C
+/* 0x2F PMSCAN_V            */ , VK_V
+/* 0x30 PMSCAN_B            */ , VK_B
+/* 0x31 PMSCAN_N            */ , VK_N
+/* 0x32 PMSCAN_M            */ , VK_M
+/* 0x33 PMSCAN_COMMA        */ , VK_COMMA
+/* 0x34 PMSCAN_PERIOD       */ , VK_PERIOD
+/* 0x35 PMSCAN_SLASH        */ , VK_SLASH
+/* 0x36 PMSCAN_SHIFTRIGHT   */ , VK_SHIFT
+/* 0x37 PMSCAN_PADASTERISK  */ , VK_MULTIPLY
+/* 0x38 PMSCAN_ALTLEFT      */ , VK_MENU
+/* 0x39 PMSCAN_SPACE        */ , VK_SPACE
+/* 0x3A PMSCAN_CAPSLOCK     */ , VK_CAPITAL
+/* 0x3B PMSCAN_F1           */ , VK_F1
+/* 0x3C PMSCAN_F2           */ , VK_F2
+/* 0x3D PMSCAN_F3           */ , VK_F3
+/* 0x3E PMSCAN_F4           */ , VK_F4
+/* 0x3F PMSCAN_F5           */ , VK_F5
+/* 0x40 PMSCAN_F6           */ , VK_F6
+/* 0x41 PMSCAN_F7           */ , VK_F7
+/* 0x42 PMSCAN_F8           */ , VK_F8
+/* 0x43 PMSCAN_F9           */ , VK_F9
+/* 0x44 PMSCAN_F10          */ , VK_F10
+/* 0x45 PMSCAN_NUMLOCK      */ , VK_NUMLOCK
+/* 0x46 PMSCAN_SCROLLLOCK   */ , VK_SCROLL
+/* 0x47 PMSCAN_PAD7         */ , VK_NUMPAD7
+/* 0x48 PMSCAN_PAD8         */ , VK_NUMPAD8
+/* 0x49 PMSCAN_PAD9         */ , VK_NUMPAD9
+/* 0x4A PMSCAN_PADMINUS     */ , VK_SUBTRACT
+/* 0x4B PMSCAN_PAD4         */ , VK_NUMPAD4
+/* 0x4C PMSCAN_PAD5         */ , VK_NUMPAD5
+/* 0x4D PMSCAN_PAD6         */ , VK_NUMPAD6
+/* 0x4E PMSCAN_PADPLUS      */ , VK_ADD
+/* 0x4F PMSCAN_PAD1         */ , VK_NUMPAD1
+/* 0x50 PMSCAN_PAD2         */ , VK_NUMPAD2
+/* 0x51 PMSCAN_PAD3         */ , VK_NUMPAD3
+/* 0x52 PMSCAN_PAD0         */ , VK_NUMPAD0
+/* 0x53 PMSCAN_PADPERIOD    */ , VK_DECIMAL
+/* 0x54 PMSCAN_SYSREQ       */ , 0x00
+/* 0x55 PMSCAN_RESET        */ , 0x00
+/* 0x56 PMSCAN_EXTRA        */ , VK_EXTRA
+/* 0x57 PMSCAN_F11          */ , VK_F11
+/* 0x58 PMSCAN_F12          */ , VK_F12
+/* 0x59 PMSCAN_BACKTAB      */ , 0x00
+/* 0x5A PMSCAN_PADENTER     */ , VK_RETURN
+/* 0x5B PMSCAN_CTRLRIGHT    */ , VK_CONTROL
+/* 0x5C PMSCAN_PADSLASH     */ , VK_DIVIDE
+/* 0x5D PMSCAN_PRINT        */ , VK_PRINT
+/* 0x5E PMSCAN_ALTRIGHT     */ , VK_MENU
+/* 0x5F PMSCAN_PAUSE        */ , VK_PAUSE
+/* 0x60 PMSCAN_HOME         */ , VK_HOME
+/* 0x61 PMSCAN_UP           */ , VK_UP
+/* 0x62 PMSCAN_PAGEUP       */ , VK_PRIOR
+/* 0x63 PMSCAN_LEFT         */ , VK_LEFT
+/* 0x64 PMSCAN_RIGHT        */ , VK_RIGHT
+/* 0x65 PMSCAN_END          */ , VK_END
+/* 0x66 PMSCAN_DOWN         */ , VK_DOWN
+/* 0x67 PMSCAN_PAGEDOWN     */ , VK_NEXT
+/* 0x68 PMSCAN_INSERT       */ , VK_INSERT
+/* 0x69 PMSCAN_DELETE       */ , VK_DELETE
+/* 0x6A PMSCAN_F23          */ , VK_F23
+/* 0x6B PMSCAN_F24          */ , VK_F24
+/* 0x6C PMSCAN_SYSMEM       */ , 0x00
+/* 0x6D PMSCAN_ERASEEOF     */ , VK_EREOF
+/* 0x6E PMSCAN_BREAK        */ , VK_CANCEL
+/* 0x6F PMSCAN_MOVEWIN      */ , 0x00
+/* 0x70 PMSCAN_NLS3         */ , 0x00
+/* 0x71 PMSCAN_HELP         */ , VK_HELP
+/* 0x72 PMSCAN_TASKMAN      */ , 0x00
+/* 0x73 PMSCAN_B11          */ , 0x00
+/* 0x74 PMSCAN_JUMP         */ , 0x00
+/* 0x75 PMSCAN_MINWIN       */ , 0x00
+/* 0x76 PMSCAN_CLEAR        */ , 0x00
+/* 0x77 PMSCAN_77           */ , 0x00
+/* 0x78 PMSCAN_78           */ , 0x00
+/* 0x79 PMSCAN_NLS2         */ , 0x00
+/* 0x7a PMSCAN_SIZE         */ , 0x00
+/* 0x7b PMSCAN_NLS1         */ , 0x00
+/* 0x7c PMSCAN_APPLICATION  */ , VK_APPS
+/* 0x7d PMSCAN_E13          */ , 0x00
+/* 0x7e PMSCAN              */ , 0x00
+/* 0x7f PMSCAN              */ , 0x00
+/* 0x80 PMSCAN_PA1          */ , VK_PA1
+/* 0x81 PMSCAN_F13          */ , VK_F13
+/* 0x82 PMSCAN_F14          */ , VK_F14
+/* 0x83 PMSCAN_F15          */ , VK_F15
+/* 0x84 PMSCAN_PA2          */ , 0x00
+/* 0x85 PMSCAN_PA3          */ , 0x00
+/* 0x86 PMSCAN_SPACEBREAK   */ , 0x00
+/* 0x87 PMSCAN_TABRIGHT     */ , 0x00
+/* 0x88 PMSCAN_NOOP         */ , 0x00
+/* 0x89 PMSCAN_F16          */ , VK_F16
+/* 0x8a PMSCAN_F17          */ , VK_F17
+/* 0x8b PMSCAN_F18          */ , VK_F18
+/* 0x8c PMSCAN_F19          */ , VK_F19
+/* 0x8d PMSCAN_F20          */ , VK_F20
+/* 0x8e PMSCAN_F21          */ , VK_F21
+/* 0x8f PMSCAN_F22          */ , VK_F22
+/* 0x90                     */ , 0x00
+/* 0x91                     */ , 0x00
+/* 0x92                     */ , 0x00
+/* 0x93                     */ , 0x00
+/* 0x94                     */ , 0x00
+/* 0x95                     */ , 0x00
+/* 0x96                     */ , 0x00
+/* 0x97                     */ , 0x00
+/* 0x98                     */ , 0x00
+/* 0x99                     */ , 0x00
+/* 0x9A                     */ , 0x00
+/* 0x9B                     */ , 0x00
+/* 0x9C                     */ , 0x00
+/* 0x9D                     */ , 0x00
+/* 0x9E                     */ , 0x00
+/* 0x9F                     */ , 0x00
+/* 0xA0                     */ , 0x00
+/* 0xA1                     */ , 0x00
+/* 0xA2                     */ , 0x00
+/* 0xA3                     */ , 0x00
+/* 0xA4                     */ , 0x00
+/* 0xA5                     */ , 0x00
+/* 0xA6                     */ , 0x00
+/* 0xA7                     */ , 0x00
+/* 0xA8                     */ , 0x00
+/* 0xA9                     */ , 0x00
+/* 0xAA                     */ , 0x00
+/* 0xAB                     */ , 0x00
+/* 0xAC                     */ , 0x00
+/* 0xAD                     */ , 0x00
+/* 0xAE                     */ , 0x00
+/* 0xAF                     */ , 0x00
+/* 0xB0                     */ , 0x00
+/* 0xB1                     */ , 0x00
+/* 0xB2                     */ , 0x00
+/* 0xB3                     */ , 0x00
+/* 0xB4                     */ , 0x00
+/* 0xB5                     */ , 0x00
+/* 0xB6                     */ , 0x00
+/* 0xB7                     */ , 0x00
+/* 0xB8                     */ , 0x00
+/* 0xB9                     */ , 0x00
+/* 0xBA                     */ , 0x00
+/* 0xBB                     */ , 0x00
+/* 0xBC                     */ , 0x00
+/* 0xBD                     */ , 0x00
+/* 0xBE                     */ , 0x00
+/* 0xBF                     */ , 0x00
+/* 0xC0                     */ , 0x00
+/* 0xC1                     */ , 0x00
+/* 0xC2                     */ , 0x00
+/* 0xC3                     */ , 0x00
+/* 0xC4                     */ , 0x00
+/* 0xC5                     */ , 0x00
+/* 0xC6                     */ , 0x00
+/* 0xC7                     */ , 0x00
+/* 0xC8                     */ , 0x00
+/* 0xC9                     */ , 0x00
+/* 0xCA                     */ , 0x00
+/* 0xCB                     */ , 0x00
+/* 0xCC                     */ , 0x00
+/* 0xCD                     */ , 0x00
+/* 0xCE                     */ , 0x00
+/* 0xCF                     */ , 0x00
+/* 0xD0                     */ , 0x00
+/* 0xD1                     */ , 0x00
+/* 0xD2                     */ , 0x00
+/* 0xD3                     */ , 0x00
+/* 0xD4                     */ , 0x00
+/* 0xD5                     */ , 0x00
+/* 0xD6                     */ , 0x00
+/* 0xD7                     */ , 0x00
+/* 0xD8                     */ , 0x00
+/* 0xD9                     */ , 0x00
+/* 0xDA                     */ , 0x00
+/* 0xDB                     */ , 0x00
+/* 0xDC                     */ , 0x00
+/* 0xDD                     */ , 0x00
+/* 0xDE                     */ , 0x00
+/* 0xDF                     */ , 0x00
+/* 0xE0                     */ , 0x00
+/* 0xE1                     */ , 0x00
+/* 0xE2                     */ , 0x00
+/* 0xE3                     */ , 0x00
+/* 0xE4                     */ , 0x00
+/* 0xE5                     */ , 0x00
+/* 0xE6                     */ , 0x00
+/* 0xE7                     */ , 0x00
+/* 0xE8                     */ , 0x00
+/* 0xE9                     */ , 0x00
+/* 0xEA                     */ , 0x00
+/* 0xEB                     */ , 0x00
+/* 0xEC                     */ , 0x00
+/* 0xED                     */ , 0x00
+/* 0xEE                     */ , 0x00
+/* 0xEF                     */ , 0x00
+/* 0xF0                     */ , 0x00
+/* 0xF1                     */ , 0x00
+/* 0xF2                     */ , 0x00
+/* 0xF3                     */ , 0x00
+/* 0xF4                     */ , 0x00
+/* 0xF5                     */ , 0x00
+/* 0xF6                     */ , 0x00
+/* 0xF7                     */ , 0x00
+/* 0xF8                     */ , 0x00
+/* 0xF9                     */ , 0x00
+/* 0xFA                     */ , 0x00
+/* 0xFB                     */ , 0x00
+/* 0xFC                     */ , 0x00
+/* 0xFD                     */ , 0x00
+/* 0xFE                     */ , 0x00
+/* 0xFF                     */ , 0x00
+                               };
+
+//******************************************************************************
+//******************************************************************************
+BYTE WIN32API KeyTranslatePMToWin(BYTE key)
+{
+   return abPMScanToWinVKey[key];
+}
+//******************************************************************************
+//******************************************************************************
+void WIN32API KeyTranslatePMToWinBuf(BYTE *pmkey, BYTE *winkey, int nrkeys)
+{
+   for(int i=0;i<nrkeys;i++) {
+    	winkey[i] = abPMScanToWinVKey[pmkey[i]];
+   }
+}
+//******************************************************************************
+//******************************************************************************
Index: trunk/src/user32/winmenu.cpp
===================================================================
--- trunk/src/user32/winmenu.cpp	(revision 1628)
+++ trunk/src/user32/winmenu.cpp	(revision 1629)
@@ -1,3 +1,3 @@
-/* $Id: winmenu.cpp,v 1.14 1999-11-05 12:54:11 sandervl Exp $ */
+/* $Id: winmenu.cpp,v 1.15 1999-11-08 13:44:17 sandervl Exp $ */
 
 /*
@@ -441,11 +441,11 @@
 
     rc = ODIN_GetMenuStringA(hMenu, idItem, astring, cchMax, fuFlags);
+    if(rc)
+    {
+            dprintf(("USER32: GetMenuStringW %s\n", astring));
+            AsciiToUnicode(astring, lpsz);
+    }
+    else    lpsz[0] = 0;
     free(astring);
-    if(rc)
-    {
-            dprintf(("USER32: OS2GetMenuStringW %s\n", astring));
-                     AsciiToUnicode(astring, lpsz);
-    }
-    else    lpsz[0] = 0;
 
     return(rc);
Index: trunk/src/user32/winmouse.cpp
===================================================================
--- trunk/src/user32/winmouse.cpp	(revision 1629)
+++ trunk/src/user32/winmouse.cpp	(revision 1629)
@@ -0,0 +1,77 @@
+/* $Id: winmouse.cpp,v 1.1 1999-11-08 13:44:40 sandervl Exp $ */
+/*
+ * Mouse handler for DINPUT
+ *
+ * Copyright 1999 Sander van Leeuwen
+ *
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+#include <os2win.h>
+#include <misc.h>
+#include "win32wbase.h"
+#include "winmouse.h"
+#include "oslibmsg.h"
+#include "pmwindow.h"
+
+LPMOUSE_EVENT_PROC mouseHandler = NULL;
+
+//******************************************************************************
+//******************************************************************************
+VOID WIN32API MOUSE_Enable(LPMOUSE_EVENT_PROC lpMouseEventProc)
+{
+  if(lpMouseEventProc == (LPMOUSE_EVENT_PROC)-1)
+  {
+	mouseHandler = NULL;
+  }
+  else	mouseHandler = lpMouseEventProc;
+}
+//******************************************************************************
+//******************************************************************************
+BOOL DInputMouseHandler(HWND hwnd, ULONG msg, ULONG x, ULONG y, ULONG info)
+{
+ WINE_MOUSEEVENT mouseEvent;
+ DWORD dwFlags = MOUSEEVENTF_ABSOLUTE;
+
+  if(!ISMOUSE_CAPTURED())
+	return FALSE;
+
+  mouseEvent.magic = WINE_MOUSEEVENT_MAGIC;
+  mouseEvent.hWnd  = hwnd;
+  mouseEvent.time  = OSLibWinQueryMsgTime();
+  mouseEvent.keyState = 0; //not used in dinput right now
+  if(msg == MOUSEMSG_BUTTON) 
+  {
+	switch(info) 
+        {
+        case BUTTON_LEFTDOWN:
+		dwFlags |= MOUSEEVENTF_LEFTDOWN;
+                break;
+        case BUTTON_LEFTUP:
+		dwFlags |= MOUSEEVENTF_LEFTUP;
+                break;
+        case BUTTON_RIGHTUP:
+		dwFlags |= MOUSEEVENTF_RIGHTUP;
+                break;
+        case BUTTON_RIGHTDOWN:
+		dwFlags |= MOUSEEVENTF_RIGHTDOWN;
+                break;
+        case BUTTON_MIDDLEUP:
+		dwFlags |= MOUSEEVENTF_MIDDLEUP;
+                break;
+        case BUTTON_MIDDLEDOWN:
+		dwFlags |= MOUSEEVENTF_MIDDLEDOWN;
+                break;
+	}
+  }
+  else  dwFlags |= MOUSEEVENTF_MOVE;
+
+  x = (((long)x << 16) + ScreenWidth-1)  / ScreenWidth;
+  y = (((long)y << 16) + ScreenHeight-1) / ScreenHeight;
+
+  mouseHandler(dwFlags, x, y, 0, (DWORD)&mouseEvent);
+  return TRUE;
+}
+//******************************************************************************
+//******************************************************************************
Index: trunk/src/user32/winmouse.h
===================================================================
--- trunk/src/user32/winmouse.h	(revision 1629)
+++ trunk/src/user32/winmouse.h	(revision 1629)
@@ -0,0 +1,25 @@
+/* $Id: winmouse.h,v 1.1 1999-11-08 13:44:41 sandervl Exp $ */
+/*
+ * Mouse handler for DINPUT
+ *
+ * Copyright 1999 Sander van Leeuwen
+ *
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+#ifndef __WINMOUSE_H__
+#define __WINMOUSE_H__
+
+#include <win\mouse.h>
+
+extern LPMOUSE_EVENT_PROC mouseHandler;
+
+#define ISMOUSE_CAPTURED()	(mouseHandler!=NULL)
+
+#define MOUSEMSG_BUTTON	0
+#define MOUSEMSG_MOVE   1
+
+BOOL DInputMouseHandler(HWND hwnd, ULONG msg, ULONG x, ULONG y, ULONG info);
+
+#endif //__WINMOUSE_H__
