chuntaro / emacs-keypression

Keystroke visualizer for GUI version Emacs.
122 stars 4 forks source link

ENT is shown as C-m #2

Closed takaxp closed 4 years ago

takaxp commented 4 years ago

When I type "ENT", then "C-m" is displayed in keycaster.

I tried the following code in keycaster-pre-command,

(message "%s - %s - %s"
  (keycaster--keys-to-string (this-command-keys-vector))
  (key-description (this-command-keys))
  (this-command-keys))

and I received the following:

C-m - RET - ^M

I think key-description will help this issue.

takaxp commented 4 years ago

Additionally, in case the following:

(message "%s - %s - %s"
  (keycaster--keys-to-string (this-command-keys-vector))
  (key-description (this-command-keys-vector))
  (this-command-keys-vector))

then,

C-m - RET - [13]

We can see similar issue on typing "delete", it shows:

^? - DEL - [127]

Best, Takaaki

chuntaro commented 4 years ago

Modified to use `key-description' and committed code. I was able to reduce unnecessary code! Thanks!

takaxp commented 4 years ago

Good for me!