Compiled meshes work
[lambdamundo.git] / keymaps.lisp
blobed08603bb86b01a0dffba6ec2f0a437cffca9281
3 (in-package :lambdamundo)
5 ;; map keys to functions
7 ;; default quit the window function
8 (make-key-function *standard-key-fns*
9 (glfw:+key-esc+ action)
10 (when (= action glfw:+press+)
11 (glfw:close-window)))
13 (make-key-function *standard-key-fns*
14 (glfw:+key-space+ action)
15 (when (= action glfw:+press+)
16 (setf *mouse-free* (not *mouse-free*))
17 (if *mouse-free*
18 (glfw:enable glfw:+mouse-cursor+)
19 (glfw:disable glfw:+mouse-cursor+))))
21 (make-key-press-function *standard-key-fns*
22 (glfw:+key-f10+ action)
23 (setf glrepl:*console* (not glrepl:*console*)))
26 ;; console stuff
28 ;; ;; backspace removes previous char
29 (make-key-press-function *console-key-fns*
30 (glfw:+key-backspace+ action)
31 (glrepl:del-char-left *glwindow*))
33 ;; ;; del removes next char
35 (make-key-press-function *console-key-fns*
36 (glfw:+key-del+ action)
37 (glrepl:del-char-right *glwindow*))
39 (make-key-press-function *console-key-fns*
40 (glfw:+key-f5+ action)
41 (progn
42 (setf (glrepl:current-result-line *glwindow*)
43 (glrepl:console-eval (glrepl:current-line-as-string glrepl:*glwindow*)))
44 (glrepl:add-to-history *glwindow* (glrepl:current-line-as-string glrepl:*glwindow*))))
46 ;; arrows move cursor
47 (make-key-press-function *console-key-fns*
48 (glfw:+key-left+ action)
49 (glrepl:cursor-left glrepl:*glwindow*))
51 (make-key-press-function *console-key-fns*
52 (glfw:+key-right+ action)
53 (cursor-right glrepl:*glwindow*))
55 ;; up down through history
56 (make-key-press-function *console-key-fns*
57 (glfw:+key-up+ action)
58 (setf (current-line *glwindow*) (glrepl:previous-history *glwindow*)))
60 (make-key-press-function *console-key-fns*
61 (glfw:+key-down+ action)
62 (setf (current-line *glwindow*) (glrepl:next-history *glwindow*)))
65 (make-key-press-function *console-key-fns*
66 (glfw:+key-f10+ action)
67 (setf glrepl:*console* (not glrepl:*console*)))
69 (make-key-function *console-key-fns*
70 (glfw:+key-esc+ action)
71 (when (= action glfw:+press+)
72 (glfw:close-window)))