logo    | Blog | Tags | Projects | Search | Contact |


Emacs lisp: which key was pressed?

03 August 2017
Posted under emacs  

Sometime you might want to know which key was pressed last in a lisp function. I came up with this little function for this purpose:

(defun last-key ()
  "Return the last key pressed."
  (car (reverse (append (recent-keys) nil))))
« autoscratch - solve the *scratch* buffer problem EU-DSGVO @daemon.de »

daemon.de © 1997-2021 Thomas von Dein | Impressum