home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / epmsmp.zip / PADPLUS.E < prev    next >
Text File  |  1992-08-26  |  854b  |  26 lines

  1. ; I like to use pad-plus as a newline key.  Unfortunately, we can't
  2. ; distinguish it in EPM since we use the ASCII codes, and PM doesn't
  3. ; distinguish between the pad keys and the main-keyboard keys.  The
  4. ; following uses the shift status to determine which is which - if
  5. ; the shift key isn't depressed when we see the '+', it must be on the
  6. ; numeric keypad (at least, for the U.S. keyboard.  If the '+' key is
  7. ; unshifted on the main keyboard for your country, then this will not
  8. ; be useful to you.)
  9.  
  10. ; By Larry Margolis
  11.  
  12.  compile if EPM
  13. def '+' =
  14.    ks = getkeystate(9)
  15. ;  sayerror 'shift_state =' ks
  16.    if ks=3 or ks=4 then  -- Unshifted; must be pad plus
  17.       down; begin_line
  18.    else                  -- Shifted, must be regular plus.
  19.       keyin '+'
  20.    endif
  21.  
  22.  compile else
  23.  
  24. def padplus=down; begin_line
  25.  compile endif
  26.