diff options
author | Brian Cully <bjc@kublai.com> | 2008-04-02 19:20:20 -0400 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2008-04-02 19:20:20 -0400 |
commit | ab10720260e2c184b319026da89f4dfd338500bb (patch) | |
tree | a692a27435da0296972e43b21b2f35762e720bfd /PlugIns/Numpad-Movement.lisp | |
download | moxie-ab10720260e2c184b319026da89f4dfd338500bb.tar.gz moxie-ab10720260e2c184b319026da89f4dfd338500bb.zip |
Initial commit
Diffstat (limited to 'PlugIns/Numpad-Movement.lisp')
-rw-r--r-- | PlugIns/Numpad-Movement.lisp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/PlugIns/Numpad-Movement.lisp b/PlugIns/Numpad-Movement.lisp new file mode 100644 index 0000000..5924b68 --- /dev/null +++ b/PlugIns/Numpad-Movement.lisp @@ -0,0 +1,45 @@ +;;; Keystroke macros to use the keypad for directional movement. +;; $Id: Numpad-Movement.lisp 20 2005-12-27 15:21:23Z bjc $ +(defpackage :numpad-movement + (:use :cl :cl-user :moxie :bjc-utils)) +(in-package :numpad-movement) + +(defun keystroke-north (&rest keywords) + (send-to-mux *world* (format nil "north~%"))) +(defun keystroke-south (&rest keywords) + (send-to-mux *world* (format nil "south~%"))) +(defun keystroke-east (&rest keywords) + (send-to-mux *world* (format nil "east~%"))) +(defun keystroke-west (&rest keywords) + (send-to-mux *world* (format nil "west~%"))) +(defun keystroke-northeast (&rest keywords) + (send-to-mux *world* (format nil "northeast~%"))) +(defun keystroke-northwest (&rest keywords) + (send-to-mux *world* (format nil "northwest~%"))) +(defun keystroke-southeast (&rest keywords) + (send-to-mux *world* (format nil "southeast~%"))) +(defun keystroke-southwest (&rest keywords) + (send-to-mux *world* (format nil "southwest~%"))) +(defun keystroke-up (&rest keywords) + (send-to-mux *world* (format nil "up~%"))) +(defun keystroke-down (&rest keywords) + (send-to-mux *world* (format nil "down~%"))) + +(defun clear-screen-fun (&optional args) + (declare (ignore arg)) + (format t "clear-screen ~S~%" *world*) + (clear-screen *world*) + nil) + +(add-keystroke-macro 'keystroke-north :numpad-8) +(add-keystroke-macro 'keystroke-south :numpad-2) +(add-keystroke-macro 'keystroke-east :numpad-6) +(add-keystroke-macro 'keystroke-west :numpad-4) +(add-keystroke-macro 'keystroke-northeast :numpad-9) +(add-keystroke-macro 'keystroke-northwest :numpad-7) +(add-keystroke-macro 'keystroke-southeast :numpad-3) +(add-keystroke-macro 'keystroke-southwest :numpad-1) +(add-keystroke-macro 'keystroke-up :numpad-+) +(add-keystroke-macro 'keystroke-down :numpad--) +(add-keystroke-macro 'clear-screen-fun :clear) +(add-keyword 'clear-screen-fun "clear")
\ No newline at end of file |