home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / epmrex.zip / ACCEL.ERX next >
Text File  |  1992-08-28  |  2KB  |  52 lines

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