(in-package :motm)
(defmethod _handle-key (int window mode)
(message "Pressed ~d" int))
(defmethod _handle-key ((int (eql (char-code #\q))) window mode)
(endwin)
(ext:quit))
(defmethod _handle-key ((int (eql (char-code #\P))) (window (eql :game)) mode)
(werase (window window)) (setf (active-window) :message) (printf :game "Pressed special key"))
(defmethod _handle-key ((int (eql (char-code #\P))) (window (eql :message)) mode)
(setf (active-window) :game) (attrs window A_STANDOUT) (message "Pressed special key") (attrs window A_NORMAL))
(defun keys-main ()
(loop
(handle-key (getch))
(draw *display*)))
(keys-main)