Use this function by Randal L. Schwartz <firstname.lastname@example.org>:
(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 <email@example.com> 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.