- Timestamp:
- Feb 16, 2003, 4:31:12 PM (23 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/Makefile
r9001 r9810 1 # $Id: Makefile,v 1.10 4 2002-08-14 10:37:43sandervl Exp $1 # $Id: Makefile,v 1.105 2003-02-16 15:31:08 sandervl Exp $ 2 2 3 3 # … … 41 41 $(OBJDIR)\wsprintf.obj \ 42 42 $(OBJDIR)\winkeyboard.obj \ 43 $(OBJDIR)\oslibkbd.obj \ 43 44 $(OBJDIR)\winmouse.obj \ 44 45 $(OBJDIR)\winevent.obj \ -
trunk/src/user32/USER32.DEF
r9523 r9810 1 ; $Id: USER32.DEF,v 1.7 5 2002-12-18 12:28:01sandervl Exp $1 ; $Id: USER32.DEF,v 1.76 2003-02-16 15:31:08 sandervl Exp $ 2 2 3 3 LIBRARY USER32 INITINSTANCE TERMINSTANCE … … 30 30 Win32QueryClipbrdViewerChain= PMMERGE.5444 31 31 Win32QueryOpenClipbrdWindow = PMMERGE.5446 32 33 WINSETSCANSTATETABLE = PMMERGE.3266 34 WINGETSCANSTATE = PMMERGE.3138 32 35 33 36 ;;;; Present in WGSS50 -
trunk/src/user32/dbglocal.cpp
r9198 r9810 1 /* $Id: dbglocal.cpp,v 1.1 4 2002-09-03 12:34:01sandervl Exp $ */1 /* $Id: dbglocal.cpp,v 1.15 2003-02-16 15:31:09 sandervl Exp $ */ 2 2 3 3 /* … … 96 96 "paint", 97 97 "dragdrop", 98 "oslibclip" 98 "oslibclip", 99 "oslibkbd" 99 100 }; 100 101 //****************************************************************************** -
trunk/src/user32/dbglocal.h
r9198 r9810 1 /* $Id: dbglocal.h,v 1.1 1 2002-09-03 12:34:01sandervl Exp $ */1 /* $Id: dbglocal.h,v 1.12 2003-02-16 15:31:09 sandervl Exp $ */ 2 2 3 3 /* … … 95 95 #define DBG_dragdrop 73 96 96 #define DBG_oslibclip 74 97 #define DBG_MAXFILES 75 97 #define DBG_oslibkbd 75 98 #define DBG_MAXFILES 76 98 99 99 100 extern USHORT DbgEnabledUSER32[DBG_MAXFILES]; -
trunk/src/user32/oslibwin.cpp
r9694 r9810 1 /* $Id: oslibwin.cpp,v 1.13 8 2003-01-20 12:09:47sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.139 2003-02-16 15:31:10 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 315 315 //****************************************************************************** 316 316 //****************************************************************************** 317 LONG OSLibWinGetPhysKeyState(LONG scan)318 {319 return WinGetPhysKeyState(HWND_DESKTOP,scan);320 }321 //******************************************************************************322 //******************************************************************************323 317 BOOL OSLibWinSetFocus(HWND hwndDeskTop,HWND hwndNewFocus, BOOL activate) 324 318 { … … 952 946 WinQuerySysValue( HWND_DESKTOP, SV_CYICON))); 953 947 return TRUE; 954 }955 //******************************************************************************956 //******************************************************************************957 BOOL OSLibWinGetKeyboardStateTable(unsigned char *PMKeyState)958 {959 return WinSetKeyboardStateTable(HWND_DESKTOP, (PBYTE)PMKeyState, FALSE );960 }961 //******************************************************************************962 //******************************************************************************963 BOOL OSLibWinSetKeyboardStateTable(unsigned char *PMKeyState)964 {965 return WinSetKeyboardStateTable(HWND_DESKTOP, (PBYTE)PMKeyState, TRUE );966 }967 //******************************************************************************968 //******************************************************************************969 USHORT APIENTRY WinTranslateChar2( USHORT /* Codepage (currently ignored) */970 , PUSHORT /* Ptr to char to translate */971 , PULONG /* Ptr to deadkey save info */972 , USHORT /* Translation option (TC_xxx) */973 , PUSHORT /* Ptr to shift state (TCF_xxx) */974 );975 //******************************************************************************976 //******************************************************************************977 USHORT OSLibWinTranslateChar(USHORT usScanCode, ULONG type, USHORT shiftstate)978 {979 USHORT usResult;980 USHORT sel = GetFS();981 982 usResult = WinTranslateChar2(0, &usScanCode, NULL, type, &shiftstate);983 SetFS(sel);984 return usScanCode;985 948 } 986 949 //****************************************************************************** -
trunk/src/user32/oslibwin.h
r9598 r9810 1 /* $Id: oslibwin.h,v 1.7 1 2003-01-03 16:35:56sandervl Exp $ */1 /* $Id: oslibwin.h,v 1.72 2003-02-16 15:31:11 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 303 303 BOOL OSLibSetWindowMinPos(HWND hwnd, ULONG x, ULONG y); 304 304 305 BOOL OSLibWinGetKeyboardStateTable(unsigned char * PMKeyState);306 BOOL OSLibWinSetKeyboardStateTable(unsigned char * PMKeyState);307 308 #define TCF_LSHIFT 0x0001309 #define TCF_RSHIFT 0x0002310 #define TCF_SHIFT (TCF_LSHIFT | TCF_RSHIFT)311 #define TCF_LCONTROL 0x0004312 #define TCF_RCONTROL 0x0008313 #define TCF_CONTROL (TCF_LCONTROL | TCF_RCONTROL)314 #define TCF_ALT 0x0010315 #define TCF_ALTGR 0x0020316 #define TCF_CAPSLOCK 0x0040317 #define TCF_NUMLOCK 0x0080318 #define TCF_OEMSCANCODE 0x0100319 #define TCF_EXTENDEDKEY 0x0200320 321 #define TC_CHARTOSCANCODE 0322 #define TC_SCANCODETOCHAR 1323 #define TC_VIRTUALKEYTOSCANCODE 2324 #define TC_SCANCODETOVIRTUALKEY 3325 #define TC_SCANTOOEMSCAN 4326 #define TC_OEMSCANTOSCAN 5327 328 USHORT OSLibWinTranslateChar(USHORT usScanCode, ULONG type, USHORT shiftstate);329 330 305 #define HTOS_NORMAL 0 331 306 #define HTOS_TRANSPARENT (-1) -
trunk/src/user32/user32dbg.def
r9523 r9810 1 ; $Id: user32dbg.def,v 1. 8 2002-12-18 12:28:05sandervl Exp $1 ; $Id: user32dbg.def,v 1.9 2003-02-16 15:31:11 sandervl Exp $ 2 2 3 3 LIBRARY USER32 INITINSTANCE TERMINSTANCE … … 30 30 Win32QueryClipbrdViewerChain= PMMERGE.5444 31 31 Win32QueryOpenClipbrdWindow = PMMERGE.5446 32 33 WINSETSCANSTATETABLE = PMMERGE.3266 34 WINGETSCANSTATE = PMMERGE.3138 32 35 33 36 ;;;; Present in WGSS50 -
trunk/src/user32/winkeyboard.cpp
r9689 r9810 1 /* $Id: winkeyboard.cpp,v 1.3 8 2003-01-17 16:35:38sandervl Exp $ */1 /* $Id: winkeyboard.cpp,v 1.39 2003-02-16 15:31:12 sandervl Exp $ */ 2 2 /* 3 3 * Win32 <-> PM key translation … … 17 17 #include <stdio.h> 18 18 #include <winkeyboard.h> 19 #include "oslib win.h"19 #include "oslibkbd.h" 20 20 #include <heapstring.h> 21 21 #include <pmscan.h> … … 415 415 /* 0x55 VK_U */ , PMSCAN_U , "U" 416 416 /* 0x56 VK_V */ , PMSCAN_V , "V" 417 /* 0x57 VK 417 /* 0x57 VK_W */ , PMSCAN_W , "W" 418 418 /* 0x58 VK_X */ , PMSCAN_X , "X" 419 419 /* 0x59 VK_Y */ , PMSCAN_Y , "Y" … … 861 861 int nrkeys) 862 862 { 863 int pmvkey; 864 865 #ifdef DEBUG 866 for(int j=1;j<nrkeys;j++) { 867 if(pmkey[j]) 868 dprintf2(("PM vkey %x state %x", j, pmkey[j])); 869 } 870 #endif 871 863 872 for(int i=1;i<nrkeys;i++) { 864 873 if(abWinVKeyToPMScan[i].bPMScanCode) { 865 winkey[i] = pmkey[OSLibWinTranslateChar(abWinVKeyToPMScan[i].bPMScanCode, TC_SCANCODETOVIRTUALKEY, 0)]; 874 pmvkey = OSLibWinTranslateChar(abWinVKeyToPMScan[i].bPMScanCode, TC_SCANCODETOVIRTUALKEY, 0); 875 if(pmvkey == 0) { 876 dprintf2(("WinTranslateChar %x (%x) FAILED!!", i, abWinVKeyToPMScan[i].bPMScanCode)); 877 } 878 winkey[i] = pmkey[pmvkey]; 866 879 } 880 else dprintf2(("key %x has no PM scancode", i)); 867 881 } 868 882 winkey[VK_SHIFT] = winkey[VK_LSHIFT] | winkey[VK_RSHIFT]; … … 970 984 BOOL WIN32API GetKeyboardState(PBYTE lpKeyState) 971 985 { 986 #if 1 987 int state; 988 for(int i=0;i<256;i++) { 989 state = GetKeyState(i); 990 lpKeyState[i] = ((state & 0x8000) >> 8) | (state & 1); 991 if(lpKeyState[i] & 0x80) { 992 dprintf2(("Win key 0x%0x = %x", i, lpKeyState[i])); 993 } 994 } 995 return TRUE; 996 #if 1 997 #else 998 BYTE PMScanState[256]; 999 BOOL rc; 1000 int state; 1001 1002 memset(PMScanState, 0, sizeof(PMScanState)); 1003 memset(lpKeyState, 0, 256); 1004 1005 // 1006 //OSLibWinGetKeyboardStateTable returns the state of PM virtual keys only and 1007 //there are far fewer PM vkeys. (e.g. 0-9, A-Z are not included) 1008 //So we need to use OSLibWinGetScanStateTable (WinSetScanState) 1009 // 1010 rc = OSLibWinGetScanStateTable((PBYTE)&PMScanState[0] ); 1011 if(!rc) { 1012 // DebugInt3(); 1013 dprintf(("OSLibWinGetScanStateTable FAILED")); 1014 return FALSE; 1015 } 1016 for(int i=0;i<256;i++) { 1017 if(abWinVKeyToPMScan[i].bPMScanCode) { 1018 lpKeyState[i] = PMScanState[abWinVKeyToPMScan[i].bPMScanCode]; 1019 } 1020 if(lpKeyState[i] & 0x80) { 1021 dprintf2(("Win key 0x%0x = %x", i, lpKeyState[i])); 1022 } 1023 } 1024 //now process the mouse buttons (left, middle, right) 1025 state = GetKeyState(VK_LBUTTON); 1026 lpKeyState[VK_LBUTTON] = ((state & 0x8000) >> 8) | (state & 1); 1027 state = GetKeyState(VK_MBUTTON); 1028 lpKeyState[VK_MBUTTON] = ((state & 0x8000) >> 8) | (state & 1); 1029 state = GetKeyState(VK_RBUTTON); 1030 lpKeyState[VK_RBUTTON] = ((state & 0x8000) >> 8) | (state & 1); 1031 #ifdef DEBUG 1032 if(lpKeyState[VK_LBUTTON]) { 1033 dprintf2(("Win key 0x%0x = %x", VK_LBUTTON, lpKeyState[VK_LBUTTON])); 1034 } 1035 if(lpKeyState[VK_MBUTTON]) { 1036 dprintf2(("Win key 0x%0x = %x", VK_MBUTTON, lpKeyState[VK_MBUTTON])); 1037 } 1038 if(lpKeyState[VK_RBUTTON]) { 1039 dprintf2(("Win key 0x%0x = %x", VK_RBUTTON, lpKeyState[VK_RBUTTON])); 1040 } 1041 #endif 1042 return TRUE; 1043 #endif 1044 #else 972 1045 BYTE PMKeyState[256]; 973 1046 BOOL rc; … … 999 1072 } 1000 1073 return FALSE; 1074 #endif 1001 1075 } 1002 1076 //****************************************************************************** … … 1152 1226 if(lpbKeyState[VK_LSHIFT] & 0x80) shiftstate |= TCF_LSHIFT; 1153 1227 if(lpbKeyState[VK_RSHIFT] & 0x80) shiftstate |= TCF_RSHIFT; 1154 if(lpbKeyState[VK_SHIFT] & 0x80) shiftstate |= TCF_SHIFT;1155 1228 if(lpbKeyState[VK_LCONTROL] & 0x80) shiftstate |= TCF_LCONTROL; 1156 1229 if(lpbKeyState[VK_RCONTROL] & 0x80) shiftstate |= TCF_RCONTROL; 1157 if(lpbKeyState[VK_CONTROL] & 0x80) shiftstate |= TCF_CONTROL;1158 1230 if(lpbKeyState[VK_LMENU] & 0x80) shiftstate |= TCF_ALT; 1159 1231 if(lpbKeyState[VK_RMENU] & 0x80) shiftstate |= TCF_ALTGR; 1160 if(lpbKeyState[VK_MENU] & 0x80) shiftstate |= TCF_ALT;1161 1232 if(lpbKeyState[VK_CAPITAL] & 1) shiftstate |= TCF_CAPSLOCK; 1162 1233 if(lpbKeyState[VK_NUMLOCK] & 1) shiftstate |= TCF_NUMLOCK; … … 1397 1468 return 0x0000; 1398 1469 } 1399 if (nVirtKey == VK_MENU) return O32_GetKeyState(VK_LMENU) | O32_GetKeyState(VK_RMENU); 1470 1471 //If there's a PM scancode for this virtual key, then call WinGetScanState 1472 //O32_GetKeyState converts windows virtual keys to PM virtual keys and there 1473 //are far fewer PM vkeys. (e.g. 0-9, A-Z will fail) 1474 if(nVirtKey < 256 && abWinVKeyToPMScan[nVirtKey].bPMScanCode) 1475 { 1476 INT nVirtKey2 = 0; 1477 WORD result; 1478 1479 if (nVirtKey == VK_MENU) { 1480 nVirtKey = VK_LMENU; 1481 nVirtKey2 = VK_RMENU; 1482 } 1483 else 1484 if (nVirtKey == VK_CONTROL) { 1485 nVirtKey = VK_LCONTROL; 1486 nVirtKey2 = VK_RCONTROL; 1487 } 1488 else 1489 if (nVirtKey == VK_SHIFT) { 1490 nVirtKey = VK_LSHIFT; 1491 nVirtKey2 = VK_RSHIFT; 1492 } 1493 result = OSLibWinGetScanState(abWinVKeyToPMScan[nVirtKey].bPMScanCode); 1494 if(nVirtKey2) { 1495 result |= OSLibWinGetScanState(abWinVKeyToPMScan[nVirtKey2].bPMScanCode); 1496 } 1497 return result; 1498 } 1499 1400 1500 return O32_GetKeyState(nVirtKey); 1401 1501 } … … 1419 1519 return 0x0000; 1420 1520 } 1421 if (nVirtKey == VK_MENU) return O32_GetAsyncKeyState(VK_LMENU) | O32_GetAsyncKeyState(VK_RMENU); 1521 1522 //If there's a PM scancode for this virtual key, then call WinGetPhysKeyState 1523 //O32_GetAsyncKeyState converts windows virtual keys to PM virtual keys and there 1524 //are far fewer PM vkeys. (e.g. 0-9, A-Z will fail) 1525 if(nVirtKey < 256 && abWinVKeyToPMScan[nVirtKey].bPMScanCode) 1526 { 1527 INT nVirtKey2 = 0; 1528 WORD result; 1529 1530 if (nVirtKey == VK_MENU) { 1531 nVirtKey = VK_LMENU; 1532 nVirtKey2 = VK_RMENU; 1533 } 1534 else 1535 if (nVirtKey == VK_CONTROL) { 1536 nVirtKey = VK_LCONTROL; 1537 nVirtKey2 = VK_RCONTROL; 1538 } 1539 else 1540 if (nVirtKey == VK_SHIFT) { 1541 nVirtKey = VK_LSHIFT; 1542 nVirtKey2 = VK_RSHIFT; 1543 } 1544 1545 result = OSLibWinGetPhysKeyState(abWinVKeyToPMScan[nVirtKey].bPMScanCode); 1546 if(nVirtKey2) { 1547 result |= OSLibWinGetPhysKeyState(abWinVKeyToPMScan[nVirtKey2].bPMScanCode); 1548 } 1549 return result; 1550 } 1551 1422 1552 return O32_GetAsyncKeyState(nVirtKey); 1423 1553 } … … 1426 1556 UINT WIN32API MapVirtualKeyA(UINT uCode, UINT uMapType) 1427 1557 { 1428 dprintf(("i mcompletely implemented"));1558 dprintf(("incompletely implemented")); 1429 1559 1430 1560 /* A quick fix for Commandos, very incomplete */ … … 1451 1581 UINT WIN32API MapVirtualKeyW(UINT uCode, UINT uMapType) 1452 1582 { 1453 dprintf(("incorrectly implemented \n"));1583 dprintf(("incorrectly implemented")); 1454 1584 1455 1585 // NOTE: This will not work as is (needs UNICODE support) 1456 return O32_MapVirtualKey(uCode,uMapType);1586 return MapVirtualKeyA(uCode,uMapType); 1457 1587 } 1458 1588 /*****************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.