Skip to content

Instantly share code, notes, and snippets.

@fgeller
Created December 7, 2014 06:46
Show Gist options
  • Save fgeller/2da26f1fb98ab4c68a42 to your computer and use it in GitHub Desktop.
Save fgeller/2da26f1fb98ab4c68a42 to your computer and use it in GitHub Desktop.
Show key presses via dribble
(defun start-recording ()
(interactive)
(setq auto-revert-interval 0.5)
(auto-revert-set-timer)
(when (file-exists-p "keys.log") (delete-file "keys.log"))
(delete-other-windows)
(split-window-vertically (- (window-height) 5))
(other-window 1)
(nlinum-mode -1)
(find-file (expand-file-name "./keys.log"))
(toggle-truncate-lines -1)
(text-scale-adjust 3)
(other-window 1))
(defun stop-recording ()
(interactive)
(open-dribble-file nil)
(when (file-exists-p "keys.log") (delete-file "keys.log"))
(when (get-buffer "keys.log") (kill-buffer "keys.log"))
(delete-other-windows))
@holtzermann17
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment