[go: up one dir, main page]

Menu

[r276]: / tags / 0.1 / TEST_keys.lisp  Maximize  Restore  History

Download this file

23 lines (15 with data), 657 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
(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)