Ignore:
Timestamp:
Jul 4, 2001, 8:39:01 AM (24 years ago)
Author:
sandervl
Message:

VkKeyScanExA/W, ToAsciiEx & MapVirtualKeyExA/W updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/user32.cpp

    r6156 r6162  
    1 /* $Id: user32.cpp,v 1.104 2001-07-03 18:33:27 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.105 2001-07-04 06:39:01 sandervl Exp $ */
    22
    33/*
     
    10771077}
    10781078
    1079 /* Keyboard and Input Functions */
    1080 
    1081 BOOL WIN32API ActivateKeyboardLayout(HKL hkl, UINT fuFlags)
    1082 {
    1083   dprintf(("USER32:  ActivateKeyboardLayout, not implemented\n"));
    1084   return(TRUE);
    1085 }
    1086 /*****************************************************************************
    1087  * Name      : UINT WIN32API GetKBCodePage
    1088  * Purpose   : The GetKBCodePage function is provided for compatibility with
    1089  *             earlier versions of Windows. In the Win32 application programming
    1090  *             interface (API) it just calls the GetOEMCP function.
    1091  * Parameters:
    1092  * Variables :
    1093  * Result    : If the function succeeds, the return value is an OEM code-page
    1094  *             identifier, or it is the default identifier if the registry
    1095  *             value is not readable. For a list of OEM code-page identifiers,
    1096  *             see GetOEMCP.
    1097  * Remark    :
    1098  * Status    : COMPLETELY IMPLEMENTED UNTESTED
    1099  *
    1100  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1101  *****************************************************************************/
    1102 
    1103 UINT WIN32API GetKBCodePage(VOID)
    1104 {
    1105   return (GetOEMCP());
    1106 }
    1107 //******************************************************************************
    1108 //******************************************************************************
    1109 int WIN32API GetKeyNameTextA( LPARAM lParam, LPSTR lpString, int  nSize)
    1110 {
    1111     dprintf(("USER32:  GetKeyNameTextA\n"));
    1112     return O32_GetKeyNameText(lParam,lpString,nSize);
    1113 }
    1114 //******************************************************************************
    1115 //******************************************************************************
    1116 int WIN32API GetKeyNameTextW( LPARAM lParam, LPWSTR lpString, int  nSize)
    1117 {
    1118     dprintf(("USER32:  GetKeyNameTextW DOES NOT WORK\n"));
    1119     // NOTE: This will not work as is (needs UNICODE support)
    1120     return 0;
    1121 //    return O32_GetKeyNameText(arg1, arg2, arg3);
    1122 }
    1123 //******************************************************************************
    1124 //******************************************************************************
    1125 SHORT WIN32API GetKeyState( int nVirtKey)
    1126 {
    1127     dprintf2(("USER32: GetKeyState %x", nVirtKey));
    1128     return O32_GetKeyState(nVirtKey);
    1129 }
    1130 //******************************************************************************
    1131 //******************************************************************************
    1132 WORD WIN32API GetAsyncKeyState(INT nVirtKey)
    1133 {
    1134     dprintf2(("USER32: GetAsyncKeyState %x", nVirtKey));
    1135     return O32_GetAsyncKeyState(nVirtKey);
    1136 }
    1137 
    1138 /*****************************************************************************
    1139  * Name      : VOID WIN32API keybd_event
    1140  * Purpose   : The keybd_event function synthesizes a keystroke. The system
    1141  *             can use such a synthesized keystroke to generate a WM_KEYUP or
    1142  *             WM_KEYDOWN message. The keyboard driver's interrupt handler calls
    1143  *             the keybd_event function.
    1144  * Parameters: BYTE  bVk         virtual-key code
    1145 
    1146  *             BYTE  bScan       hardware scan code
    1147  *             DWORD dwFlags     flags specifying various function options
    1148  *             DWORD dwExtraInfo additional data associated with keystroke
    1149  * Variables :
    1150  * Result    :
    1151  * Remark    :
    1152  * Status    : UNTESTED STUB
    1153  *
    1154  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1155  *****************************************************************************/
    1156 VOID WIN32API keybd_event (BYTE bVk,
    1157                            BYTE bScan,
    1158                            DWORD dwFlags,
    1159                            DWORD dwExtraInfo)
    1160 {
    1161   dprintf(("USER32:keybd_event (%u,%u,%08xh,%08x) not implemented.\n",
    1162          bVk,
    1163          bScan,
    1164          dwFlags,
    1165          dwExtraInfo));
    1166 }
    1167 /*****************************************************************************
    1168  * Name      : HLK WIN32API LoadKeyboardLayoutA
    1169  * Purpose   : The LoadKeyboardLayout function loads a new keyboard layout into
    1170  *             the system. Several keyboard layouts can be loaded at a time, but
    1171  *             only one per process is active at a time. Loading multiple keyboard
    1172  *             layouts makes it possible to rapidly switch between layouts.
    1173  * Parameters:
    1174  * Variables :
    1175  * Result    : If the function succeeds, the return value is the handle of the
    1176  *               keyboard layout.
    1177  *             If the function fails, the return value is NULL. To get extended
    1178  *               error information, call GetLastError.
    1179  * Remark    :
    1180  * Status    : UNTESTED STUB
    1181  *
    1182  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1183  *****************************************************************************/
    1184 HKL WIN32API LoadKeyboardLayoutA(LPCTSTR pwszKLID,
    1185                                  UINT    Flags)
    1186 {
    1187   dprintf(("USER32:LeadKeyboardLayoutA (%s,%u) not implemented.\n",
    1188          pwszKLID,
    1189          Flags));
    1190 
    1191   return (NULL);
    1192 }
    1193 /*****************************************************************************
    1194  * Name      : HLK WIN32API LoadKeyboardLayoutW
    1195  * Purpose   : The LoadKeyboardLayout function loads a new keyboard layout into
    1196  *             the system. Several keyboard layouts can be loaded at a time, but
    1197  *             only one per process is active at a time. Loading multiple keyboard
    1198  *             layouts makes it possible to rapidly switch between layouts.
    1199  * Parameters:
    1200  * Variables :
    1201  * Result    : If the function succeeds, the return value is the handle of the
    1202  *               keyboard layout.
    1203  *             If the function fails, the return value is NULL. To get extended
    1204  *               error information, call GetLastError.
    1205  * Remark    :
    1206  * Status    : UNTESTED STUB
    1207  *
    1208  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1209  *****************************************************************************/
    1210 HKL WIN32API LoadKeyboardLayoutW(LPCWSTR pwszKLID,
    1211                                  UINT    Flags)
    1212 {
    1213   dprintf(("USER32:LeadKeyboardLayoutW (%s,%u) not implemented.\n",
    1214          pwszKLID,
    1215          Flags));
    1216 
    1217   return (NULL);
    1218 }
    1219 //******************************************************************************
    1220 //******************************************************************************
    1221 UINT WIN32API MapVirtualKeyA( UINT uCode, UINT  uMapType)
    1222 {
    1223     dprintf(("USER32:  MapVirtualKeyA\n"));
    1224     /* A quick fix for Commandos, very incomplete */
    1225     switch (uMapType) {
    1226     case 2:
    1227       if (uCode >= VK_A && uCode <= VK_Z) {
    1228          return 'A' + uCode - VK_A;
    1229       }
    1230       break;
    1231     }
    1232     return O32_MapVirtualKey(uCode,uMapType);
    1233 }
    1234 //******************************************************************************
    1235 //******************************************************************************
    1236 UINT WIN32API MapVirtualKeyW( UINT uCode, UINT  uMapType)
    1237 {
    1238     dprintf(("USER32:  MapVirtualKeyW\n"));
    1239     // NOTE: This will not work as is (needs UNICODE support)
    1240     return O32_MapVirtualKey(uCode,uMapType);
    1241 }
    1242 /*****************************************************************************
    1243  * Name      : UINT WIN32API MapVirtualKeyExA
    1244  * Purpose   : The MapVirtualKeyEx function translates (maps) a virtual-key
    1245  *             code into a scan code or character value, or translates a scan
    1246  *             code into a virtual-key code. The function translates the codes
    1247  *             using the input language and physical keyboard layout identified
    1248  *             by the given keyboard layout handle.
    1249  * Parameters:
    1250  * Variables :
    1251  * Result    : The return value is either a scan code, a virtual-key code, or
    1252  *             a character value, depending on the value of uCode and uMapType.
    1253  *             If there is no translation, the return value is zero.
    1254  * Remark    :
    1255  * Status    : UNTESTED STUB
    1256  *
    1257  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1258  *****************************************************************************/
    1259 UINT WIN32API MapVirtualKeyExA(UINT uCode,
    1260                                   UINT uMapType,
    1261                                   HKL  dwhkl)
    1262 {
    1263   dprintf(("USER32:MapVirtualKeyExA (%u,%u,%08x) not implemented.\n",
    1264          uCode,
    1265          uMapType,
    1266          dwhkl));
    1267 
    1268   return (0);
    1269 }
    1270 /*****************************************************************************
    1271  * Name      : UINT WIN32API MapVirtualKeyExW
    1272  * Purpose   : The MapVirtualKeyEx function translates (maps) a virtual-key
    1273  *             code into a scan code or character value, or translates a scan
    1274  *             code into a virtual-key code. The function translates the codes
    1275  *             using the input language and physical keyboard layout identified
    1276  *             by the given keyboard layout handle.
    1277  * Parameters:
    1278  * Variables :
    1279  * Result    : The return value is either a scan code, a virtual-key code, or
    1280  *             a character value, depending on the value of uCode and uMapType.
    1281  *             If there is no translation, the return value is zero.
    1282  * Remark    :
    1283  * Status    : UNTESTED STUB
    1284 
    1285  *
    1286  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1287  *****************************************************************************/
    1288 UINT WIN32API MapVirtualKeyExW(UINT uCode,
    1289                                   UINT uMapType,
    1290                                   HKL  dwhkl)
    1291 {
    1292   dprintf(("USER32:MapVirtualKeyExW (%u,%u,%08x) not implemented.\n",
    1293          uCode,
    1294          uMapType,
    1295          dwhkl));
    1296 
    1297   return (0);
    1298 }
    1299 /*****************************************************************************
    1300  * Name      : DWORD WIN32API OemKeyScan
    1301  * Purpose   : The OemKeyScan function maps OEM ASCII codes 0 through 0x0FF
    1302  *             into the OEM scan codes and shift states. The function provides
    1303  *             information that allows a program to send OEM text to another
    1304  *             program by simulating keyboard input.
    1305  * Parameters:
    1306  * Variables :
    1307  * Result    :
    1308  * Remark    :
    1309  * Status    : UNTESTED STUB
    1310  *
    1311  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1312  *****************************************************************************/
    1313 DWORD WIN32API OemKeyScan(WORD wOemChar)
    1314 {
    1315   dprintf(("USER32:OemKeyScan (%u) not implemented.\n",
    1316          wOemChar));
    1317 
    1318   return (wOemChar);
    1319 }
    1320 //******************************************************************************
    1321 //******************************************************************************
    1322 BOOL WIN32API RegisterHotKey(HWND hwnd, int idHotKey, UINT fuModifiers, UINT uVirtKey)
    1323 {
    1324   dprintf(("USER32:  RegisterHotKey, not implemented\n"));
    1325   hwnd = Win32ToOS2Handle(hwnd);
    1326   return(TRUE);
    1327 }
    1328 /*****************************************************************************
    1329  * Name      : BOOL WIN32API UnloadKeyboardLayout
    1330  * Purpose   : The UnloadKeyboardLayout function removes a keyboard layout.
    1331  * Parameters: HKL hkl handle of keyboard layout
    1332  * Variables :
    1333  * Result    : If the function succeeds, the return value is the handle of the
    1334  *             keyboard layout; otherwise, it is NULL. To get extended error
    1335  *             information, use the GetLastError function.
    1336  * Remark    :
    1337  * Status    : UNTESTED STUB
    1338  *
    1339  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1340  *****************************************************************************/
    1341 BOOL WIN32API UnloadKeyboardLayout (HKL hkl)
    1342 {
    1343   dprintf(("USER32:UnloadKeyboardLayout (%08x) not implemented.\n",
    1344          hkl));
    1345 
    1346   return (0);
    1347 }
    1348 //******************************************************************************
    1349 //******************************************************************************
    1350 BOOL WIN32API UnregisterHotKey(HWND hwnd, int idHotKey)
    1351 {
    1352   dprintf(("USER32:  UnregisterHotKey, not implemented\n"));
    1353   hwnd = Win32ToOS2Handle(hwnd);
    1354 
    1355   return(TRUE);
    1356 }
    1357 //******************************************************************************
    1358 //SvL: 24-6-'97 - Added
    1359 //******************************************************************************
    1360 WORD WIN32API VkKeyScanA( char ch)
    1361 {
    1362     dprintf(("USER32: VkKeyScanA %x", ch));
    1363     return O32_VkKeyScan(ch);
    1364 }
    1365 //******************************************************************************
    1366 //******************************************************************************
    1367 WORD WIN32API VkKeyScanW( WCHAR wch)
    1368 {
    1369     dprintf(("USER32:  VkKeyScanW %x", wch));
    1370     // NOTE: This will not work as is (needs UNICODE support)
    1371     return O32_VkKeyScan((char)wch);
    1372 }
    1373 /*****************************************************************************
    1374  * Name      : SHORT WIN32API VkKeyScanExW
    1375  * Purpose   : The VkKeyScanEx function translates a character to the
    1376  *             corresponding virtual-key code and shift state. The function
    1377  *             translates the character using the input language and physical
    1378  *             keyboard layout identified by the given keyboard layout handle.
    1379  * Parameters: UINT uChar character to translate
    1380  *             HKL  hkl   keyboard layout handle
    1381  * Variables :
    1382  * Result    : see docs
    1383  * Remark    :
    1384  * Status    : UNTESTED STUB
    1385  *
    1386  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1387  *****************************************************************************/
    1388 WORD WIN32API VkKeyScanExW(WCHAR uChar,
    1389                            HKL   hkl)
    1390 {
    1391   dprintf(("USER32:VkKeyScanExW (%u,%08x) not implemented.\n",
    1392          uChar,
    1393          hkl));
    1394 
    1395   return (uChar);
    1396 }
    1397 /*****************************************************************************
    1398  * Name      : SHORT WIN32API VkKeyScanExA
    1399  * Purpose   : The VkKeyScanEx function translates a character to the
    1400  *             corresponding virtual-key code and shift state. The function
    1401  *             translates the character using the input language and physical
    1402  *             keyboard layout identified by the given keyboard layout handle.
    1403  * Parameters: UINT uChar character to translate
    1404  *             HKL  hkl   keyboard layout handle
    1405  * Variables :
    1406  * Result    : see docs
    1407  * Remark    :
    1408  * Status    : UNTESTED STUB
    1409  *
    1410  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1411  *****************************************************************************/
    1412 WORD WIN32API VkKeyScanExA(CHAR uChar,
    1413                            HKL  hkl)
    1414 {
    1415   dprintf(("USER32:VkKeyScanExA (%u,%08x) not implemented.\n",
    1416          uChar,
    1417          hkl));
    1418 
    1419   return (uChar);
    1420 }
    14211079
    14221080/* Window Functions */
Note: See TracChangeset for help on using the changeset viewer.