Skip to content

Instantly share code, notes, and snippets.

@ThomasAdam
Created January 4, 2019 17:52
Show Gist options
  • Save ThomasAdam/833d5ff8e77df14bf18d0b8e7fcf4114 to your computer and use it in GitHub Desktop.
Save ThomasAdam/833d5ff8e77df14bf18d0b8e7fcf4114 to your computer and use it in GitHub Desktop.
stumpwm show key presses
;; display the key sequence in progress
(defun key-press-hook (key key-seq cmd)
(declare (ignore key))
(unless (eq *top-map* *resize-map*)
(let ((*message-window-gravity* :bottom-right))
(message "Keys: ~a" (print-key-seq (reverse key-seq))))
(when (stringp cmd)
;; give 'em time to read it
(sleep 0.5))))
(defmacro replace-hook (hook fn)
`(remove-hook ,hook ,fn)
`(add-hook ,hook ,fn))
(replace-hook *key-press-hook* 'key-press-hook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment