Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1155 lines
33 KiB

  1. //******************************************************************************
  2. // File: \wacker\tdll\keyutil.c Created: 6/4/98 By: Dwayne M. Newsome
  3. //
  4. // Copyright 1998 by Hilgraeve Inc. --- Monroe, MI
  5. // All rights reserved
  6. //
  7. // Description:
  8. // This file contains utility functions to handle keyboard macros and macro
  9. // GUI display.
  10. //
  11. // $Revision: 7 $
  12. // $Date: 3/26/02 8:32a $
  13. // $Id: keyutil.c 1.4 1998/09/15 10:32:51 bld Exp $
  14. //
  15. //******************************************************************************
  16. #include <windows.h>
  17. #pragma hdrstop
  18. #include "stdtyp.h"
  19. #include "mc.h"
  20. #ifdef INCL_KEY_MACROS
  21. #include "globals.h"
  22. #include <term\res.h>
  23. #include "keyutil.h"
  24. #include "chars.h"
  25. #include "htchar.h"
  26. DWORD dwKeyLookup[] =
  27. {
  28. VK_LBUTTON, IDS_MACRO_BUTTON1,
  29. VK_MBUTTON, IDS_MACRO_BUTTON2,
  30. VK_RBUTTON, IDS_MACRO_BUTTON3,
  31. VK_CANCEL, IDS_MACRO_BREAK,
  32. VK_BACK, IDS_MACRO_BS,
  33. VK_TAB, IDS_MACRO_TAB,
  34. VK_PAUSE, IDS_MACRO_PAUSE,
  35. VK_PAUSE | ALT_KEY | EXTENDED_KEY, IDS_MACRO_INTERRUPT,
  36. VK_ESCAPE, IDS_MACRO_ESC,
  37. VK_PRIOR, IDS_MACRO_PAGEUP,
  38. VK_PRIOR | EXTENDED_KEY, IDS_MACRO_PAGEUP,
  39. VK_NEXT, IDS_MACRO_PAGEDOWN,
  40. VK_NEXT | EXTENDED_KEY, IDS_MACRO_PAGEDOWN,
  41. VK_END, IDS_MACRO_END,
  42. VK_END | EXTENDED_KEY, IDS_MACRO_END,
  43. VK_HOME, IDS_MACRO_HOME,
  44. VK_HOME | EXTENDED_KEY, IDS_MACRO_HOME,
  45. VK_LEFT, IDS_MACRO_LEFT,
  46. VK_LEFT | EXTENDED_KEY, IDS_MACRO_LEFT,
  47. VK_UP, IDS_MACRO_UP,
  48. VK_UP | EXTENDED_KEY, IDS_MACRO_UP,
  49. VK_RIGHT, IDS_MACRO_RIGHT,
  50. VK_RIGHT | EXTENDED_KEY, IDS_MACRO_RIGHT,
  51. VK_DOWN, IDS_MACRO_DOWN,
  52. VK_DOWN | EXTENDED_KEY, IDS_MACRO_DOWN,
  53. VK_CLEAR, IDS_MACRO_CENTER,
  54. VK_SNAPSHOT, IDS_MACRO_PRNTSCREEN,
  55. VK_INSERT, IDS_MACRO_INSERT,
  56. VK_INSERT | EXTENDED_KEY, IDS_MACRO_INSERT,
  57. VK_DELETE, IDS_MACRO_DEL,
  58. VK_DELETE | EXTENDED_KEY, IDS_MACRO_DEL,
  59. VK_RETURN, IDS_MACRO_ENTER,
  60. VK_RETURN | EXTENDED_KEY, IDS_MACRO_NEWLINE,
  61. VK_F1, IDS_MACRO_F1,
  62. VK_F2, IDS_MACRO_F2,
  63. VK_F3, IDS_MACRO_F3,
  64. VK_F4, IDS_MACRO_F4,
  65. VK_F5, IDS_MACRO_F5,
  66. VK_F6, IDS_MACRO_F6,
  67. VK_F7, IDS_MACRO_F7,
  68. VK_F8, IDS_MACRO_F8,
  69. VK_F9, IDS_MACRO_F9,
  70. VK_F10, IDS_MACRO_F10,
  71. VK_F11, IDS_MACRO_F11,
  72. VK_F12, IDS_MACRO_F12,
  73. VK_F13, IDS_MACRO_F13,
  74. VK_F14, IDS_MACRO_F14,
  75. VK_F15, IDS_MACRO_F15,
  76. VK_F16, IDS_MACRO_F16,
  77. VK_F17, IDS_MACRO_F17,
  78. VK_F18, IDS_MACRO_F18,
  79. VK_F19, IDS_MACRO_F19,
  80. VK_F20, IDS_MACRO_F20,
  81. VK_F21, IDS_MACRO_F21,
  82. VK_F22, IDS_MACRO_F22,
  83. VK_F23, IDS_MACRO_F23,
  84. VK_F24, IDS_MACRO_F24,
  85. VK_EREOF, IDS_MACRO_EREOF,
  86. VK_PA1, IDS_MACRO_PA1,
  87. VK_ADD, IDS_MACRO_ADD,
  88. VK_ADD | EXTENDED_KEY, IDS_MACRO_ADD,
  89. VK_SUBTRACT, IDS_MACRO_MINUS,
  90. VK_SUBTRACT | EXTENDED_KEY, IDS_MACRO_MINUS,
  91. VK_DECIMAL, IDS_MACRO_NUMPADPERIOD,
  92. VK_NUMPAD0, IDS_MACRO_NUMPAD0,
  93. VK_NUMPAD1, IDS_MACRO_NUMPAD1,
  94. VK_NUMPAD2, IDS_MACRO_NUMPAD2,
  95. VK_NUMPAD3, IDS_MACRO_NUMPAD3,
  96. VK_NUMPAD4, IDS_MACRO_NUMPAD4,
  97. VK_NUMPAD5, IDS_MACRO_NUMPAD5,
  98. VK_NUMPAD6, IDS_MACRO_NUMPAD6,
  99. VK_NUMPAD7, IDS_MACRO_NUMPAD7,
  100. VK_NUMPAD8, IDS_MACRO_NUMPAD8,
  101. VK_NUMPAD9, IDS_MACRO_NUMPAD9,
  102. VK_DECIMAL, IDS_MACRO_DECIMAL,
  103. VK_RETURN, IDS_MACRO_ENTER,
  104. VK_DIVIDE, IDS_MACRO_FSLASH,
  105. VK_DIVIDE | EXTENDED_KEY, IDS_MACRO_FSLASH,
  106. VK_MULTIPLY, IDS_MACRO_MULTIPLY,
  107. VK_MULTIPLY | EXTENDED_KEY, IDS_MACRO_MULTIPLY,
  108. VK_NUMLOCK, IDS_MACRO_NUMLOCK,
  109. VK_SCROLL, IDS_MACRO_SCRLLOCK,
  110. VK_CAPITAL, IDS_MACRO_CAPSLOCK
  111. };
  112. //******************************************************************************
  113. // Method:
  114. // keysCreateKeyMacro
  115. //
  116. // Description:
  117. // Creates a blank key macro structure. The caller is responsible for freeing
  118. // the memory
  119. //
  120. // Arguments:
  121. // void
  122. //
  123. // Returns:
  124. // keyMacro *
  125. //
  126. // Throws:
  127. // None
  128. //
  129. // Author: Dwayne M. Newsome, 6/7/98
  130. //
  131. //
  132. keyMacro * keysCreateKeyMacro( void )
  133. {
  134. keyMacro * pKeyMacro;
  135. pKeyMacro = (keyMacro *)malloc(sizeof(keyMacro));
  136. pKeyMacro->keyName = 0;
  137. pKeyMacro->macroLen = 0;
  138. pKeyMacro->editMode = 0;
  139. pKeyMacro->altKeyValue = 0;
  140. pKeyMacro->altKeyCount = 0;
  141. pKeyMacro->keyCount = 0;
  142. pKeyMacro->insertMode = 0;
  143. pKeyMacro->hSession = 0;
  144. pKeyMacro->lpWndProc = 0;
  145. memset( pKeyMacro->keyMacro, 0, KEYS_MAX_KEYS * sizeof(KEYDEF) );
  146. return pKeyMacro;
  147. }
  148. //******************************************************************************
  149. // Method:
  150. // keysCloneKeyMacro
  151. //
  152. // Description:
  153. // Creates an exact copy of the supplied key macro. The caller is responsible
  154. // for freeing the allocated memory.
  155. //
  156. // Arguments:
  157. // aKeyMacro - The key macro to be cloned
  158. //
  159. // Returns:
  160. // keyMacro *
  161. //
  162. // Throws:
  163. // None
  164. //
  165. // Author: Dwayne M. Newsome, 6/7/98
  166. //
  167. //
  168. keyMacro * keysCloneKeyMacro( const keyMacro * aKeyMacro )
  169. {
  170. keyMacro * pKeyMacro;
  171. pKeyMacro = (keyMacro *)malloc(sizeof(keyMacro));
  172. pKeyMacro->keyName = aKeyMacro->keyName;
  173. pKeyMacro->macroLen = aKeyMacro->macroLen;
  174. pKeyMacro->editMode = aKeyMacro->editMode;
  175. pKeyMacro->altKeyValue = aKeyMacro->altKeyValue;
  176. pKeyMacro->altKeyCount = aKeyMacro->altKeyCount;
  177. pKeyMacro->keyCount = aKeyMacro->keyCount;
  178. pKeyMacro->insertMode = aKeyMacro->insertMode;
  179. pKeyMacro->hSession = aKeyMacro->hSession;
  180. pKeyMacro->lpWndProc = aKeyMacro->lpWndProc;
  181. MemCopy( pKeyMacro->keyMacro, aKeyMacro->keyMacro, KEYS_MAX_KEYS );
  182. return pKeyMacro;
  183. }
  184. //******************************************************************************
  185. // Method:
  186. // keysGetDisplayString
  187. //
  188. // Description:
  189. // Formats a display string from the supplied keydefs
  190. //
  191. // Arguments:
  192. // pKeydef - Pointer to keydefs
  193. // aNumKeys - Number of keydefs to format
  194. // aDisplayString - String to format into
  195. // aMaxLen - Length of display string
  196. //
  197. // Returns:
  198. // 0 for failure non zero for success
  199. //
  200. // Throws:
  201. // None
  202. //
  203. // Author: Dwayne M. Newsome, 6/4/98
  204. //
  205. //
  206. int keysGetDisplayString( KEYDEF * pKeydef, int aNumKeys, LPTSTR aDisplayString,
  207. unsigned int aMaxLen )
  208. {
  209. BOOL fSpecial = FALSE;
  210. int lIndex;
  211. KEYDEF lKey;
  212. TCHAR lKeyBuffer[35];
  213. unsigned int lMaxLen = aMaxLen / sizeof(TCHAR);
  214. TCHAR_Fill( aDisplayString, TEXT('\0'), lMaxLen );
  215. for ( lIndex = 0; lIndex < aNumKeys; lIndex++ )
  216. {
  217. lKey = pKeydef[lIndex];
  218. fSpecial = FALSE;
  219. //
  220. // Check for special character and add the necessary indicators
  221. //
  222. if ( lKey & CTRL_KEY || lKey & ALT_KEY || lKey & SHIFT_KEY ||
  223. lKey & VIRTUAL_KEY )
  224. {
  225. strcat( aDisplayString, TEXT("<") );
  226. fSpecial = TRUE;
  227. }
  228. if ( lKey & CTRL_KEY )
  229. {
  230. LoadString( glblQueryDllHinst(), IDS_MACRO_CTRL, lKeyBuffer,
  231. sizeof(lKeyBuffer) / sizeof(TCHAR) );
  232. if ( (unsigned int)(StrCharGetStrLength( aDisplayString ) + StrCharGetStrLength( lKeyBuffer )) >= lMaxLen )
  233. {
  234. return 0;
  235. }
  236. strcat( aDisplayString, lKeyBuffer );
  237. }
  238. if ( lKey & ALT_KEY )
  239. {
  240. LoadString( glblQueryDllHinst(), IDS_MACRO_ALT, lKeyBuffer,
  241. sizeof(lKeyBuffer) / sizeof(TCHAR) );
  242. if ( (unsigned int)(StrCharGetStrLength( aDisplayString ) + StrCharGetStrLength( lKeyBuffer )) >= lMaxLen )
  243. {
  244. return 0;
  245. }
  246. strcat( aDisplayString, lKeyBuffer );
  247. }
  248. if ( lKey & SHIFT_KEY )
  249. {
  250. LoadString( glblQueryDllHinst(), IDS_MACRO_SHIFT, lKeyBuffer,
  251. sizeof(lKeyBuffer) / sizeof(TCHAR) );
  252. if ( (unsigned int)(StrCharGetStrLength( aDisplayString ) + StrCharGetStrLength( lKeyBuffer )) >= lMaxLen ) {
  253. return 0;
  254. }
  255. strcat( aDisplayString, lKeyBuffer );
  256. }
  257. //
  258. // Add on the actual key definition
  259. //
  260. if ( lKey & VIRTUAL_KEY )
  261. {
  262. if ( !keysLookupKeyHVK( lKey, lKeyBuffer, sizeof(lKeyBuffer) ) )
  263. {
  264. LoadString( glblQueryDllHinst(), IDS_MACRO_UNKNOWN, lKeyBuffer,
  265. sizeof(lKeyBuffer) / sizeof(TCHAR) );
  266. }
  267. if ( (unsigned int)(StrCharGetStrLength( aDisplayString ) + StrCharGetStrLength( lKeyBuffer )) >= lMaxLen )
  268. {
  269. return 0;
  270. }
  271. strcat( aDisplayString, lKeyBuffer );
  272. }
  273. else
  274. {
  275. if ( !keysLookupKeyASCII( lKey, lKeyBuffer, sizeof(lKeyBuffer) / sizeof(TCHAR) ) )
  276. {
  277. LoadString( glblQueryDllHinst(), IDS_MACRO_UNKNOWN, lKeyBuffer,
  278. sizeof(lKeyBuffer) / sizeof(TCHAR) );
  279. }
  280. if ( (unsigned int)(StrCharGetStrLength( aDisplayString ) + StrCharGetStrLength( lKeyBuffer )) >= lMaxLen )
  281. {
  282. return 0;
  283. }
  284. strcat( aDisplayString, lKeyBuffer );
  285. }
  286. //
  287. // if this is a special key add the trailing > character
  288. //
  289. if ( fSpecial )
  290. {
  291. strcat( aDisplayString, TEXT( ">" ) );
  292. }
  293. }
  294. return 1;
  295. }
  296. //******************************************************************************
  297. // Method:
  298. // keysIsKeyHVK
  299. //
  300. // Description:
  301. // Looks up a key definition and returns true if it is a virtual key
  302. //
  303. // Arguments:
  304. // aKey - The key to lookup
  305. //
  306. // Returns:
  307. // 0 if key was not found non zero if not
  308. //
  309. // Throws:
  310. // None
  311. //
  312. // Author: Dwayne M. Newsome, 6/4/98
  313. //
  314. //
  315. int keysIsKeyHVK( KEYDEF aKey )
  316. {
  317. int nReturn = 0;
  318. int nIndex = 0;
  319. int nSizeLookup = sizeof(dwKeyLookup) / sizeof(dwKeyLookup[0]);
  320. aKey = (TCHAR)aKey;
  321. for (nIndex = 0; nIndex < nSizeLookup; nIndex += 2)
  322. {
  323. if ( (KEYDEF) dwKeyLookup[nIndex] == aKey )
  324. {
  325. nReturn = 1;
  326. break;
  327. }
  328. }
  329. return nReturn;
  330. }
  331. //******************************************************************************
  332. // Method:
  333. // keysLookupKeyHVK
  334. //
  335. // Description:
  336. // Looks up a key definition and returns a string representation
  337. //
  338. // Arguments:
  339. // aKey - The key to lookup
  340. // aKeyName - The string representation
  341. // aNameSize - Max length for returned name in bytes
  342. //
  343. // Returns:
  344. // 0 if key was not found non zero if key name is filled in
  345. //
  346. // Throws:
  347. // None
  348. //
  349. // Author: Dwayne M. Newsome, 6/4/98
  350. //
  351. //
  352. int keysLookupKeyHVK( KEYDEF aKey, LPTSTR aKeyName, int aNameSize )
  353. {
  354. int nReturn = 0;
  355. int nIndex = 0;
  356. int nSizeLookup = sizeof(dwKeyLookup) / sizeof(dwKeyLookup[0]);
  357. aKey = (TCHAR)aKey;
  358. for (nIndex = 0; nIndex < nSizeLookup; nIndex += 2)
  359. {
  360. if ( (KEYDEF) dwKeyLookup[nIndex] == aKey )
  361. {
  362. LoadString(glblQueryDllHinst(), dwKeyLookup[nIndex+1],
  363. aKeyName, aNameSize);
  364. nReturn = 1;
  365. break;
  366. }
  367. }
  368. return nReturn;
  369. }
  370. //******************************************************************************
  371. // Method:
  372. // keysLookupKeyASCII
  373. //
  374. // Description:
  375. // Looks up a key definition and returns a string representation
  376. //
  377. // Arguments:
  378. // aKey - The key to lookup
  379. // aKeyName - The string representation
  380. // aNameSize - Max length for returned name in bytes
  381. //
  382. // Returns:
  383. // 0 if key was not found non zero if key name is filled in
  384. //
  385. // Throws:
  386. // None
  387. //
  388. // Author: Dwayne M. Newsome, 6/4/98
  389. //
  390. //
  391. int keysLookupKeyASCII( KEYDEF aKey, LPTSTR aKeyName, int aNameSize )
  392. {
  393. int nReturn = 1;
  394. TCHAR lKey = (TCHAR)aKey;
  395. if ( lKey > 0xFF || lKey < 0 )
  396. {
  397. nReturn = 0;
  398. }
  399. //
  400. // get non printable characters first
  401. //
  402. else if ( lKey < 0x20 || lKey > 0x7E )
  403. {
  404. switch( lKey )
  405. {
  406. case 0x00:
  407. StrCharCopyN( aKeyName, TEXT("<CTRL-@>"), aNameSize );
  408. break;
  409. case 0x01:
  410. StrCharCopyN( aKeyName, TEXT("<CTRL-A>"), aNameSize );
  411. break;
  412. case 0x02:
  413. StrCharCopyN( aKeyName, TEXT("<CTRL-B>"), aNameSize );
  414. break;
  415. case 0x03:
  416. StrCharCopyN( aKeyName, TEXT("<CTRL-C>"), aNameSize );
  417. break;
  418. case 0x04:
  419. StrCharCopyN( aKeyName, TEXT("<CTRL-D>"), aNameSize );
  420. break;
  421. case 0x05:
  422. StrCharCopyN( aKeyName, TEXT("<CTRL-E>"), aNameSize );
  423. break;
  424. case 0x06:
  425. StrCharCopyN( aKeyName, TEXT("<CTRL-F>"), aNameSize );
  426. break;
  427. case 0x07:
  428. StrCharCopyN( aKeyName, TEXT("<CTRL-G>"), aNameSize );
  429. break;
  430. case 0x08:
  431. StrCharCopyN( aKeyName, TEXT("<CTRL-H>"), aNameSize );
  432. break;
  433. case 0x09:
  434. StrCharCopyN( aKeyName, TEXT("<CTRL-I>"), aNameSize );
  435. break;
  436. case 0x0A:
  437. StrCharCopyN( aKeyName, TEXT("<CTRL-J>"), aNameSize );
  438. break;
  439. case 0x0B:
  440. StrCharCopyN( aKeyName, TEXT("<CTRL-K>"), aNameSize );
  441. break;
  442. case 0x0C:
  443. StrCharCopyN( aKeyName, TEXT("<CTRL-L>"), aNameSize );
  444. break;
  445. case 0x0D:
  446. StrCharCopyN( aKeyName, TEXT("<ENTER>"), aNameSize );
  447. break;
  448. case 0x0E:
  449. StrCharCopyN( aKeyName, TEXT("<CTRL-N>"), aNameSize );
  450. break;
  451. case 0x0F:
  452. StrCharCopyN( aKeyName, TEXT("<CTRL-O>"), aNameSize );
  453. break;
  454. case 0x10:
  455. StrCharCopyN( aKeyName, TEXT("<CTRL-P>"), aNameSize );
  456. break;
  457. case 0x11:
  458. StrCharCopyN( aKeyName, TEXT("<CTRL-Q>"), aNameSize );
  459. break;
  460. case 0x12:
  461. StrCharCopyN( aKeyName, TEXT("<CTRL-R>"), aNameSize );
  462. break;
  463. case 0x13:
  464. StrCharCopyN( aKeyName, TEXT("<CTRL-S>"), aNameSize );
  465. break;
  466. case 0x14:
  467. StrCharCopyN( aKeyName, TEXT("<CTRL-T>"), aNameSize );
  468. break;
  469. case 0x15:
  470. StrCharCopyN( aKeyName, TEXT("<CTRL-U>"), aNameSize );
  471. break;
  472. case 0x16:
  473. StrCharCopyN( aKeyName, TEXT("<CTRL-V>"), aNameSize );
  474. break;
  475. case 0x17:
  476. StrCharCopyN( aKeyName, TEXT("<CTRL-W>"), aNameSize );
  477. break;
  478. case 0x18:
  479. StrCharCopyN( aKeyName, TEXT("<CTRL-X>"), aNameSize );
  480. break;
  481. case 0x19:
  482. StrCharCopyN( aKeyName, TEXT("<CTRL-Y>"), aNameSize );
  483. break;
  484. case 0x1A:
  485. StrCharCopyN( aKeyName, TEXT("<CTRL-Z>"), aNameSize );
  486. break;
  487. case 0x1B:
  488. StrCharCopyN( aKeyName, TEXT("<ESC>"), aNameSize );
  489. break;
  490. case 0x1C:
  491. StrCharCopyN( aKeyName, TEXT("<CTRL-/>"), aNameSize );
  492. break;
  493. case 0x1D:
  494. StrCharCopyN( aKeyName, TEXT("<CTRL-]>"), aNameSize );
  495. break;
  496. case 0x1E:
  497. StrCharCopyN( aKeyName, TEXT("<CTRL-^>"), aNameSize );
  498. break;
  499. case 0x1F:
  500. StrCharCopyN( aKeyName, TEXT("<CTRL-_>"), aNameSize );
  501. break;
  502. case 0x7F:
  503. StrCharCopyN( aKeyName, TEXT("<ALT-127>"), aNameSize );
  504. break;
  505. case 0x80:
  506. StrCharCopyN( aKeyName, TEXT("<ALT-128>"), aNameSize );
  507. break;
  508. case 0x81:
  509. StrCharCopyN( aKeyName, TEXT("<ALT-129>"), aNameSize );
  510. break;
  511. case 0x82:
  512. StrCharCopyN( aKeyName, TEXT("<ALT-130>"), aNameSize );
  513. break;
  514. case 0x83:
  515. StrCharCopyN( aKeyName, TEXT("<ALT-131>"), aNameSize );
  516. break;
  517. case 0x84:
  518. StrCharCopyN( aKeyName, TEXT("<ALT-132>"), aNameSize );
  519. break;
  520. case 0x85:
  521. StrCharCopyN( aKeyName, TEXT("<ALT-133>"), aNameSize );
  522. break;
  523. case 0x86:
  524. StrCharCopyN( aKeyName, TEXT("<ALT-134>"), aNameSize );
  525. break;
  526. case 0x87:
  527. StrCharCopyN( aKeyName, TEXT("<ALT-135>"), aNameSize );
  528. break;
  529. case 0x88:
  530. StrCharCopyN( aKeyName, TEXT("<ALT-136>"), aNameSize );
  531. break;
  532. case 0x89:
  533. StrCharCopyN( aKeyName, TEXT("<ALT-137>"), aNameSize );
  534. break;
  535. case 0x8A:
  536. StrCharCopyN( aKeyName, TEXT("<ALT-138>"), aNameSize );
  537. break;
  538. case 0x8B:
  539. StrCharCopyN( aKeyName, TEXT("<ALT-139>"), aNameSize );
  540. break;
  541. case 0x8C:
  542. StrCharCopyN( aKeyName, TEXT("<ALT-140>"), aNameSize );
  543. break;
  544. case 0x8D:
  545. StrCharCopyN( aKeyName, TEXT("<ALT-141>"), aNameSize );
  546. break;
  547. case 0x8E:
  548. StrCharCopyN( aKeyName, TEXT("<ALT-142>"), aNameSize );
  549. break;
  550. case 0x8F:
  551. StrCharCopyN( aKeyName, TEXT("<ALT-143>"), aNameSize );
  552. break;
  553. case 0x90:
  554. StrCharCopyN( aKeyName, TEXT("<ALT-144>"), aNameSize );
  555. break;
  556. case 0x91:
  557. StrCharCopyN( aKeyName, TEXT("<ALT-145>"), aNameSize );
  558. break;
  559. case 0x92:
  560. StrCharCopyN( aKeyName, TEXT("<ALT-146>"), aNameSize );
  561. break;
  562. case 0x93:
  563. StrCharCopyN( aKeyName, TEXT("<ALT-147>"), aNameSize );
  564. break;
  565. case 0x94:
  566. StrCharCopyN( aKeyName, TEXT("<ALT-148>"), aNameSize );
  567. break;
  568. case 0x95:
  569. StrCharCopyN( aKeyName, TEXT("<ALT-149>"), aNameSize );
  570. break;
  571. case 0x96:
  572. StrCharCopyN( aKeyName, TEXT("<ALT-150>"), aNameSize );
  573. break;
  574. case 0x97:
  575. StrCharCopyN( aKeyName, TEXT("<ALT-151>"), aNameSize );
  576. break;
  577. case 0x98:
  578. StrCharCopyN( aKeyName, TEXT("<ALT-152>"), aNameSize );
  579. break;
  580. case 0x99:
  581. StrCharCopyN( aKeyName, TEXT("<ALT-153>"), aNameSize );
  582. break;
  583. case 0x9A:
  584. StrCharCopyN( aKeyName, TEXT("<ALT-154>"), aNameSize );
  585. break;
  586. case 0x9B:
  587. StrCharCopyN( aKeyName, TEXT("<ALT-155>"), aNameSize );
  588. break;
  589. case 0x9C:
  590. StrCharCopyN( aKeyName, TEXT("<ALT-156>"), aNameSize );
  591. break;
  592. case 0x9D:
  593. StrCharCopyN( aKeyName, TEXT("<ALT-157>"), aNameSize );
  594. break;
  595. case 0x9E:
  596. StrCharCopyN( aKeyName, TEXT("<ALT-158>"), aNameSize );
  597. break;
  598. case 0x9F:
  599. StrCharCopyN( aKeyName, TEXT("<ALT-159>"), aNameSize );
  600. break;
  601. case 0xA0:
  602. StrCharCopyN( aKeyName, TEXT("<ALT-160>"), aNameSize );
  603. break;
  604. case 0xA1:
  605. StrCharCopyN( aKeyName, TEXT("<ALT-161>"), aNameSize );
  606. break;
  607. case 0xA2:
  608. StrCharCopyN( aKeyName, TEXT("<ALT-162>"), aNameSize );
  609. break;
  610. case 0xA3:
  611. StrCharCopyN( aKeyName, TEXT("<ALT-163>"), aNameSize );
  612. break;
  613. case 0xA4:
  614. StrCharCopyN( aKeyName, TEXT("<ALT-164>"), aNameSize );
  615. break;
  616. case 0xA5:
  617. StrCharCopyN( aKeyName, TEXT("<ALT-165>"), aNameSize );
  618. break;
  619. case 0xA6:
  620. StrCharCopyN( aKeyName, TEXT("<ALT-166>"), aNameSize );
  621. break;
  622. case 0xA7:
  623. StrCharCopyN( aKeyName, TEXT("<ALT-167>"), aNameSize );
  624. break;
  625. case 0xA8:
  626. StrCharCopyN( aKeyName, TEXT("<ALT-168>"), aNameSize );
  627. break;
  628. case 0xA9:
  629. StrCharCopyN( aKeyName, TEXT("<ALT-169>"), aNameSize );
  630. break;
  631. case 0xAA:
  632. StrCharCopyN( aKeyName, TEXT("<ALT-170>"), aNameSize );
  633. break;
  634. case 0xAB:
  635. StrCharCopyN( aKeyName, TEXT("<ALT-171>"), aNameSize );
  636. break;
  637. case 0xAC:
  638. StrCharCopyN( aKeyName, TEXT("<ALT-172>"), aNameSize );
  639. break;
  640. case 0xAD:
  641. StrCharCopyN( aKeyName, TEXT("<ALT-173>"), aNameSize );
  642. break;
  643. case 0xAE:
  644. StrCharCopyN( aKeyName, TEXT("<ALT-174>"), aNameSize );
  645. break;
  646. case 0xAF:
  647. StrCharCopyN( aKeyName, TEXT("<ALT-175>"), aNameSize );
  648. break;
  649. case 0xB0:
  650. StrCharCopyN( aKeyName, TEXT("<ALT-176>"), aNameSize );
  651. break;
  652. case 0xB1:
  653. StrCharCopyN( aKeyName, TEXT("<ALT-177>"), aNameSize );
  654. break;
  655. case 0xB2:
  656. StrCharCopyN( aKeyName, TEXT("<ALT-178>"), aNameSize );
  657. break;
  658. case 0xB3:
  659. StrCharCopyN( aKeyName, TEXT("<ALT-179>"), aNameSize );
  660. break;
  661. case 0xB4:
  662. StrCharCopyN( aKeyName, TEXT("<ALT-180>"), aNameSize );
  663. break;
  664. case 0xB5:
  665. StrCharCopyN( aKeyName, TEXT("<ALT-181>"), aNameSize );
  666. break;
  667. case 0xB6:
  668. StrCharCopyN( aKeyName, TEXT("<ALT-182>"), aNameSize );
  669. break;
  670. case 0xB7:
  671. StrCharCopyN( aKeyName, TEXT("<ALT-183>"), aNameSize );
  672. break;
  673. case 0xB8:
  674. StrCharCopyN( aKeyName, TEXT("<ALT-184>"), aNameSize );
  675. break;
  676. case 0xB9:
  677. StrCharCopyN( aKeyName, TEXT("<ALT-185>"), aNameSize );
  678. break;
  679. case 0xBA:
  680. StrCharCopyN( aKeyName, TEXT("<ALT-186>"), aNameSize );
  681. break;
  682. case 0xBB:
  683. StrCharCopyN( aKeyName, TEXT("<ALT-187>"), aNameSize );
  684. break;
  685. case 0xBC:
  686. StrCharCopyN( aKeyName, TEXT("<ALT-188>"), aNameSize );
  687. break;
  688. case 0xBD:
  689. StrCharCopyN( aKeyName, TEXT("<ALT-189>"), aNameSize );
  690. break;
  691. case 0xBE:
  692. StrCharCopyN( aKeyName, TEXT("<ALT-190>"), aNameSize );
  693. break;
  694. case 0xBF:
  695. StrCharCopyN( aKeyName, TEXT("<ALT-191>"), aNameSize );
  696. break;
  697. case 0xC0:
  698. StrCharCopyN( aKeyName, TEXT("<ALT-192>"), aNameSize );
  699. break;
  700. case 0xC1:
  701. StrCharCopyN( aKeyName, TEXT("<ALT-193>"), aNameSize );
  702. break;
  703. case 0xC2:
  704. StrCharCopyN( aKeyName, TEXT("<ALT-194>"), aNameSize );
  705. break;
  706. case 0xC3:
  707. StrCharCopyN( aKeyName, TEXT("<ALT-195>"), aNameSize );
  708. break;
  709. case 0xC4:
  710. StrCharCopyN( aKeyName, TEXT("<ALT-196>"), aNameSize );
  711. break;
  712. case 0xC5:
  713. StrCharCopyN( aKeyName, TEXT("<ALT-197>"), aNameSize );
  714. break;
  715. case 0xC6:
  716. StrCharCopyN( aKeyName, TEXT("<ALT-198>"), aNameSize );
  717. break;
  718. case 0xC7:
  719. StrCharCopyN( aKeyName, TEXT("<ALT-199>"), aNameSize );
  720. break;
  721. case 0xC8:
  722. StrCharCopyN( aKeyName, TEXT("<ALT-200>"), aNameSize );
  723. break;
  724. case 0xC9:
  725. StrCharCopyN( aKeyName, TEXT("<ALT-201>"), aNameSize );
  726. break;
  727. case 0xCA:
  728. StrCharCopyN( aKeyName, TEXT("<ALT-202>"), aNameSize );
  729. break;
  730. case 0xCB:
  731. StrCharCopyN( aKeyName, TEXT("<ALT-203>"), aNameSize );
  732. break;
  733. case 0xCC:
  734. StrCharCopyN( aKeyName, TEXT("<ALT-204>"), aNameSize );
  735. break;
  736. case 0xCD:
  737. StrCharCopyN( aKeyName, TEXT("<ALT-205>"), aNameSize );
  738. break;
  739. case 0xCE:
  740. StrCharCopyN( aKeyName, TEXT("<ALT-206>"), aNameSize );
  741. break;
  742. case 0xCF:
  743. StrCharCopyN( aKeyName, TEXT("<ALT-207>"), aNameSize );
  744. break;
  745. case 0xD0:
  746. StrCharCopyN( aKeyName, TEXT("<ALT-208>"), aNameSize );
  747. break;
  748. case 0xD1:
  749. StrCharCopyN( aKeyName, TEXT("<ALT-209>"), aNameSize );
  750. break;
  751. case 0xD2:
  752. StrCharCopyN( aKeyName, TEXT("<ALT-210>"), aNameSize );
  753. break;
  754. case 0xD3:
  755. StrCharCopyN( aKeyName, TEXT("<ALT-211>"), aNameSize );
  756. break;
  757. case 0xD4:
  758. StrCharCopyN( aKeyName, TEXT("<ALT-212>"), aNameSize );
  759. break;
  760. case 0xD5:
  761. StrCharCopyN( aKeyName, TEXT("<ALT-213>"), aNameSize );
  762. break;
  763. case 0xD6:
  764. StrCharCopyN( aKeyName, TEXT("<ALT-214>"), aNameSize );
  765. break;
  766. case 0xD7:
  767. StrCharCopyN( aKeyName, TEXT("<ALT-215>"), aNameSize );
  768. break;
  769. case 0xD8:
  770. StrCharCopyN( aKeyName, TEXT("<ALT-216>"), aNameSize );
  771. break;
  772. case 0xD9:
  773. StrCharCopyN( aKeyName, TEXT("<ALT-217>"), aNameSize );
  774. break;
  775. case 0xDA:
  776. StrCharCopyN( aKeyName, TEXT("<ALT-218>"), aNameSize );
  777. break;
  778. case 0xDB:
  779. StrCharCopyN( aKeyName, TEXT("<ALT-219>"), aNameSize );
  780. break;
  781. case 0xDC:
  782. StrCharCopyN( aKeyName, TEXT("<ALT-220>"), aNameSize );
  783. break;
  784. case 0xDD:
  785. StrCharCopyN( aKeyName, TEXT("<ALT-221>"), aNameSize );
  786. break;
  787. case 0xDE:
  788. StrCharCopyN( aKeyName, TEXT("<ALT-222>"), aNameSize );
  789. break;
  790. case 0xDF:
  791. StrCharCopyN( aKeyName, TEXT("<ALT-223>"), aNameSize );
  792. break;
  793. case 0xE0:
  794. StrCharCopyN( aKeyName, TEXT("<ALT-224>"), aNameSize );
  795. break;
  796. case 0xE1:
  797. StrCharCopyN( aKeyName, TEXT("<ALT-225>"), aNameSize );
  798. break;
  799. case 0xE2:
  800. StrCharCopyN( aKeyName, TEXT("<ALT-226>"), aNameSize );
  801. break;
  802. case 0xE3:
  803. StrCharCopyN( aKeyName, TEXT("<ALT-227>"), aNameSize );
  804. break;
  805. case 0xE4:
  806. StrCharCopyN( aKeyName, TEXT("<ALT-228>"), aNameSize );
  807. break;
  808. case 0xE5:
  809. StrCharCopyN( aKeyName, TEXT("<ALT-229>"), aNameSize );
  810. break;
  811. case 0xE6:
  812. StrCharCopyN( aKeyName, TEXT("<ALT-230>"), aNameSize );
  813. break;
  814. case 0xE7:
  815. StrCharCopyN( aKeyName, TEXT("<ALT-231>"), aNameSize );
  816. break;
  817. case 0xE8:
  818. StrCharCopyN( aKeyName, TEXT("<ALT-232>"), aNameSize );
  819. break;
  820. case 0xE9:
  821. StrCharCopyN( aKeyName, TEXT("<ALT-233>"), aNameSize );
  822. break;
  823. case 0xEA:
  824. StrCharCopyN( aKeyName, TEXT("<ALT-234>"), aNameSize );
  825. break;
  826. case 0xEB:
  827. StrCharCopyN( aKeyName, TEXT("<ALT-235>"), aNameSize );
  828. break;
  829. case 0xEC:
  830. StrCharCopyN( aKeyName, TEXT("<ALT-236>"), aNameSize );
  831. break;
  832. case 0xED:
  833. StrCharCopyN( aKeyName, TEXT("<ALT-237>"), aNameSize );
  834. break;
  835. case 0xEE:
  836. StrCharCopyN( aKeyName, TEXT("<ALT-238>"), aNameSize );
  837. break;
  838. case 0xEF:
  839. StrCharCopyN( aKeyName, TEXT("<ALT-239>"), aNameSize );
  840. break;
  841. case 0xF0:
  842. StrCharCopyN( aKeyName, TEXT("<ALT-240>"), aNameSize );
  843. break;
  844. case 0xF1:
  845. StrCharCopyN( aKeyName, TEXT("<ALT-241>"), aNameSize );
  846. break;
  847. case 0xF2:
  848. StrCharCopyN( aKeyName, TEXT("<ALT-242>"), aNameSize );
  849. break;
  850. case 0xF3:
  851. StrCharCopyN( aKeyName, TEXT("<ALT-243>"), aNameSize );
  852. break;
  853. case 0xF4:
  854. StrCharCopyN( aKeyName, TEXT("<ALT-244>"), aNameSize );
  855. break;
  856. case 0xF5:
  857. StrCharCopyN( aKeyName, TEXT("<ALT-245>"), aNameSize );
  858. break;
  859. case 0xF6:
  860. StrCharCopyN( aKeyName, TEXT("<ALT-246>"), aNameSize );
  861. break;
  862. case 0xF7:
  863. StrCharCopyN( aKeyName, TEXT("<ALT-247>"), aNameSize );
  864. break;
  865. case 0xF8:
  866. StrCharCopyN( aKeyName, TEXT("<ALT-248>"), aNameSize );
  867. break;
  868. case 0xF9:
  869. StrCharCopyN( aKeyName, TEXT("<ALT-249>"), aNameSize );
  870. break;
  871. case 0xFA:
  872. StrCharCopyN( aKeyName, TEXT("<ALT-250>"), aNameSize );
  873. break;
  874. case 0xFB:
  875. StrCharCopyN( aKeyName, TEXT("<ALT-251>"), aNameSize );
  876. break;
  877. case 0xFC:
  878. StrCharCopyN( aKeyName, TEXT("<ALT-252>"), aNameSize );
  879. break;
  880. case 0xFD:
  881. StrCharCopyN( aKeyName, TEXT("<ALT-253>"), aNameSize );
  882. break;
  883. case 0xFE:
  884. StrCharCopyN( aKeyName, TEXT("<ALT-254>"), aNameSize );
  885. break;
  886. case 0xFF:
  887. StrCharCopyN( aKeyName, TEXT("<ALT-255>"), aNameSize );
  888. break;
  889. default:
  890. nReturn = 0;
  891. break;
  892. } // END OF SWITCH
  893. }
  894. else
  895. {
  896. TCHAR lBuffer[2];
  897. lBuffer[0] = lKey;
  898. lBuffer[1] = TEXT('\0');
  899. StrCharCopyN( aKeyName, lBuffer, aNameSize );
  900. }
  901. return nReturn;
  902. }
  903. //******************************************************************************
  904. // Method:
  905. // keysResetKeyMacro
  906. //
  907. // Description:
  908. // Clears a key macro structure.
  909. //
  910. // Arguments:
  911. // aKeyMacro - The key macro to be reset
  912. //
  913. // Returns:
  914. // keyMacro *
  915. //
  916. // Throws:
  917. // None
  918. //
  919. // Author: Dwayne M. Newsome, 6/7/98
  920. //
  921. //
  922. void keysResetKeyMacro( keyMacro * aKeyMacro )
  923. {
  924. aKeyMacro->keyName = 0;
  925. aKeyMacro->macroLen = 0;
  926. aKeyMacro->editMode = 0;
  927. aKeyMacro->altKeyValue = 0;
  928. aKeyMacro->altKeyCount = 0;
  929. aKeyMacro->keyCount = 0;
  930. aKeyMacro->insertMode = 0;
  931. aKeyMacro->lpWndProc = 0;
  932. memset( aKeyMacro->keyMacro, 0, KEYS_MAX_KEYS * sizeof(KEYDEF) );
  933. return;
  934. }
  935. #endif