- mouse-mixin class with on-mouse-down/up/move/scroll handler slots - handle-mouse-event dispatches to the right handler by event type - hit-test finds deepest component at (x,y) coordinates - selection struct + get-selection + copy-to-clipboard - SGR mouse parsing already existed in input system (mouse-event struct, parse-sgr-mouse function, CSI dispatch in %read-escape-sequence) - 3 tests, 100% passing
10 lines
285 B
Common Lisp
10 lines
285 B
Common Lisp
(defpackage :cl-tty.mouse
|
|
(:use :cl :cl-tty.input :cl-tty.box)
|
|
(:export
|
|
#:mouse-mixin
|
|
#:on-mouse-down #:on-mouse-up #:on-mouse-move #:on-mouse-scroll
|
|
#:handle-mouse-event
|
|
#:hit-test
|
|
#:selection #:get-selection #:copy-to-clipboard
|
|
#:make-selection #:selection-p))
|