class
Opal::Input::MouseMap
- Opal::Input::MouseMap
- Reference
- Object
Overview
Declarative mouse event routing, click handling, and hit-testing DSL.
Defined in:
opal/input/mouse_map.crInstance Method Summary
-
#handle(event : Terminal::MouseEvent) : Bool
Dispatches a MouseEvent to all matching handlers.
-
#on(action : Symbol, button : Terminal::MouseButton | Nil = nil, &block : Terminal::MouseEvent -> Nil) : self
Registers a click handler with optional button constraint (:left, :middle, :right)
- #on_click(button : Terminal::MouseButton | Nil = nil, &block : Terminal::MouseEvent -> Nil) : self
- #on_scroll_down(&block : Terminal::MouseEvent -> Nil) : self
- #on_scroll_up(&block : Terminal::MouseEvent -> Nil) : self
-
#zone(x : Range(Int32, Int32), y : Range(Int32, Int32), &block : Terminal::MouseEvent -> Nil) : self
Registers a bounding-box hit test zone (e.g.
Instance Method Detail
def handle(event : Terminal::MouseEvent) : Bool
#
Dispatches a MouseEvent to all matching handlers. Returns true if at least one handler processed the event, false otherwise.
def on(action : Symbol, button : Terminal::MouseButton | Nil = nil, &block : Terminal::MouseEvent -> Nil) : self
#
Registers a click handler with optional button constraint (:left, :middle, :right)
def on_click(button : Terminal::MouseButton | Nil = nil, &block : Terminal::MouseEvent -> Nil) : self
#
def zone(x : Range(Int32, Int32), y : Range(Int32, Int32), &block : Terminal::MouseEvent -> Nil) : self
#
Registers a bounding-box hit test zone (e.g. for buttons, tabs, or cards)