(require :input-event-codes) ;; Print all constants and their values (do-external-symbols (sym :input-event-codes) (format t "~S = ~D" sym (symbol-value sym))) ;; Convoluted example... (defun handle-button-event (code pressed-p) (when (= btn input-event-codes:+btn-left+) ...))
There is currently only support for Linux and FreeBSD. The library uses trivial-features to conditionally load the appropriate constant set. If this or a similar header is found in other operating systems, please let me know and I will add them. :)
The Linux Kernel docs provides an outline over all the event code constants.
#x10respectively on FreeBSD, but
#x11respectively on Linux.
These constants are available on Linux only: