home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / ME22-OS2.ZIP / MACROS.ZIP / WHATCHAR.M < prev    next >
Text File  |  1988-03-22  |  476b  |  22 lines

  1. /*
  2. WHATCHAR
  3. The whatchar() macro is invoked by pressing <CTRL Q>. It prints the ASCII
  4. value of the character over the cursor on the status line. A nice idea
  5. would be to set a hook to this function so that this value is displayed
  6. somewhere on the screen after every key is pressed.
  7. */
  8.  
  9. #define CTRL_Q  17
  10.  
  11. init()
  12. {
  13.   assign_key("what_char", CTRL_Q);
  14. }
  15.  
  16. what_char()
  17. {
  18.   message(sprintf("Character under the cursor is %d", currchar()));
  19.   get_tty_char();
  20. }
  21.  
  22.