Go to the first, previous, next, last section, table of contents.

How do I tell what characters my function or arrow keys emit?

Use this function by Randal L. Schwartz <merlyn@iwarp.intel.com>:

  (defun see-chars ()
    "Displays characters typed, terminated by a 3-second timeout."
    (interactive)
    (let ((chars "")
          (inhibit-quit t))
      (message "Enter characters, terminated by 3-second timeout.")
      (while (not (sit-for 3))
        (setq chars (concat chars (list (read-char)))
      	quit-flag nil))		; quit-flag maybe set by C-g
      (message "Characters entered: %s" (key-description chars))))

Alternatively, use the "C-h l" view-lossage command, which will display the last 100 characters Emacs has seen in its input stream. Kevin Gallagher <kgallagh@digi.lonestar.org> suggests typing some unique string like "wxyz", typing the key in question, then typing "C-h l". The characters that appear between "wxyz" and "C-h l" were generated by the key.


Go to the first, previous, next, last section, table of contents.