OSDN Git Service

inputs.lisp: better input system for mouse
[rulp/rulp.git] / graphics / package.lisp
index 59174c6..7be7b95 100644 (file)
@@ -38,13 +38,13 @@ grid square of the entity"
   )
 
 ;; tr stands for text-rendering
-(defparameter *tr-string* "abcdefghijklmnopqrstuvwxyz 0123456789"
+(defparameter *tr-string* "abcdefghijklmnopqrstuvwxyz 0123456789-"
   "This string is used to generate a texture with the alphabet, the software
 in the text.lisp file will 'write' on the screen selecting squares and using
 this string again to parse a string variable into coordinate in the texture"
   )
 
-(defparameter *alphabet* "abcdefghijklmnopqrstuvwxyz"
+(defparameter *alphabet* "abcdefghijklmnopqrstuvwxyz-"
   "this is used to generate the grid, when the coordinates run out of letters
 they restart from the beginning"
   )
@@ -59,19 +59,14 @@ with render-copy")
 (defconstant +mouse-button-middle+ 2 "this binds the scroll button")
 
 (defparameter *mouse-keybinds* (list
-                                '(+mouse-button-left+ select-pointer)
-                                ;; '(+mouse-button-middle+ mouse-view)
-                                '(+mouse-button-right+ move-entity)
+                                '(+mouse-button-left+ nil (select-pointer *mouse-position* +plane+))
+                                '(+mouse-button-middle+ (panning (coordinate +plane+) (velocity *mouse-position* *mouse-previous-position*)))
+                                '(+mouse-button-right+ nil (move-entity *mouse-position* +plane+))
                                 )
-  "This list associate the button presses to a certain action, the action is evaluated
-as shown in graphics/input.lisp"
+  "This is the mouse-keybinds association list. The first value is the button, the second
+is the action executed on hold and the third is the action executed on release (if any)"
   )
 
-(defparameter *previous-mouse-position* '(0 0))
-(defparameter *mouse-movement-delta* '(0 0)
-  "this parameter acknowledge saves the difference between the frames in mouse position.
-It is used to move the plane around using the mouse")
-
 
 (defparameter *is-grid* t
   "Parameter for displaying the grid, when nil it does not display a grid, when t