io:caps-key-down

(io:caps-key-down key)


Description:

Defining the function caps-key-down taking a single argument (key) will capture all caps lock key presses


Arguments:

            key -- the ascii key value of the caps key pressed


Returns: boolean


Related: io:caps-key-up io:alt-key-up io:alt-key-down 


Examples:

; engage caps-lock to receive caps key strokes

; caps key down message

(define io:caps-key-down

   (lambda (key)

      (if (assoc key key-map)

          (start-note (now) inst (cdr (assoc key key-map)) 80)

          (print "BAD KEY PRESS"))))


; engage caps-lock to receive caps key strokes

; caps key up message

(define io:caps-key-up

   (lambda (key)

      (if (assoc key key-map)

          (stop-sound (now) inst (cdr (assoc key key-map)))

          (print "BAD KEY PRESS"))))



Back to index