home *** CD-ROM | disk | FTP | other *** search
- /* Demonstrate BuildAccel, by Larry Margolis
- buildaccel table flags key index command
- where :
- table = the name of the accelerator table, or '*' for the current one;
- flags = any combination of the AF_ flags defined below;
- key = an ASCII code (for AF_CHAR) or virtual key code (for AF_VIRTUALKEY);
- index = a unique index value for this table. STDCTRL.E currently uses 1000 - 1502.
-
- The default accelerator table is 'defaccel'.
- */
- AF_CHAR = 1 /* key style constants */
- AF_VIRTUALKEY = 2
- AF_SCANCODE = 4
- AF_SHIFT = 8
- AF_CONTROL = 16
- AF_ALT = 32
- AF_LONEKEY = 64
- AF_SYSCOMMAND = 256
- AF_HELP = 512
-
- VK_BUTTON1 = 1 /* Some virtual keys; */
- VK_BUTTON2 = 2 /* check the toolkit for the complete list */
- VK_BUTTON3 = 3
- VK_BACKSPACE = 5
- VK_NEWLINE = 8 /* Note: this is the regular Enter key. */
- VK_SHIFT = 9
- VK_CTRL = 10
- VK_ALT = 11
- VK_CAPSLOCK = 14
- VK_INSERT = 26
- VK_DELETE = 27
- VK_SCRLLOCK = 28
- VK_NUMLOCK = 29
- VK_ENTER = 30 /* Note: this is the numeric keypad Enter key. */
- VK_F1 = 32
- VK_F2 = 33
- VK_F3 = 34
- VK_F4 = 35
- VK_F5 = 36
- VK_F6 = 37
- VK_F7 = 38
- VK_F8 = 39
- VK_F9 = 40
- VK_F10 = 41
- VK_F11 = 42
- VK_F12 = 43
-
- 'buildaccel *' (AF_CHAR + AF_CONTROL) 122 9000 'sayerror Ctrl+z pressed' /* ASCII 122 = 'z' */
- 'buildaccel *' (AF_CHAR + AF_CONTROL) 90 9001 'sayerror Ctrl+Z pressed' /* ASCII 90 = 'Z' */
- 'buildaccel *' (AF_VIRTUALKEY + AF_ALT) VK_F1 9002 'qtime' /* Alt+F1 tells the time */
- 'activateaccel' /* No argument => use current table name. */
-