Input functions availible in the fluxus scratchpad.
boolean
Returns true if the specified key is currently pressed down.
(if (key-pressed "q") (display "q pressed!))
keys-list
Returns a list of keys pressed down
(display (keys-down))
boolean
Returns true if the specified special key is currently pressed down. Special keys are ones which do not map to ascii values. The easiest way of finding what they are is to print out the result of key-special-pressed while holding down the key you are after.
(if (key-special-pressed 100) (display "left cursor pressed")) (if (key-special-pressed 102) (display "right cursor pressed")) (if (key-special-pressed 101) (display "up cursor pressed")) (if (key-special-pressed 103) (display "down cursor pressed"))
keys-list
Returns a list of special keys pressed down
(display (keys-special-down))
coord-number
Returns the x position of the mouse
(display (mouse-x))
coord-number
Returns the y position of the mouse
(display (mouse-y))
boolean
Returns true if the specifed mouse button is pressed
(display (mouse-button 1))
primitiveid-number
Returns the object the mouse is currently over.
(grab (mouse-over)) (colour (vector 1 0 0)) ; paints objects the mouse is over red (ungrab) (define (mouse-over) (select (vector-ref mouse 0) (vector-ref mouse 1) 3))