Skip to content

Instantly share code, notes, and snippets.

@winny-
Created May 8, 2020 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save winny-/f17fd8d8bb411ac3b8c5b3db6eee6c63 to your computer and use it in GitHub Desktop.
Save winny-/f17fd8d8bb411ac3b8c5b3db6eee6c63 to your computer and use it in GitHub Desktop.
;; Via
;; https://github.com/stumpwm/stumpwm/wiki/Tips-And-Tricks
(defun show-key-seq (key seq val)
(message (print-key-seq (reverse seq))))
(add-hook *key-press-hook* 'show-key-seq)
;; Via Ticks and Tricks (above)
(stumpwm:add-hook stumpwm:*destroy-window-hook*
#'(lambda (win) (stumpwm:repack-window-numbers)))
(defcommand toggle-show-keys () ()
"Toggle echoing back keys in the message area."
(if (member 'show-key-seq *key-press-hook*)
(progn
(remove-hook *key-press-hook* 'show-key-seq)
(message "Hiding keys…"))
(progn
(add-hook *key-press-hook* 'show-key-seq)
(message "Showing keys…"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment