home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / editor / me / whatchar.m < prev    next >
Text File  |  1994-01-31  |  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.