io:caps-key-up

(io:caps-key-up key)


Description:

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


Arguments:

            key -- ascii char key


Returns: boolean


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


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