← All compilation units

Flyology_TUI.Mouse

Description

Contains

function Contains
  (Item  : Region;
   Event : Flyology_TUI.Events.Mouse_Event) return Boolean

Return whether a mouse event lies inside Region.

Parameters
Item
Event
Return value

Contains

function Contains
  (Item : Region;
   X, Y : Natural) return Boolean

Return whether a terminal-cell coordinate lies inside Region.

Parameters
Item
X
Y
Return value

Local_Event

type Local_Event is record
   X          : Integer := 0;
   Y          : Integer := 0;
   Button     : Flyology_TUI.Events.Mouse_Button :=
     Flyology_TUI.Events.No_Button;
   Action     : Flyology_TUI.Events.Mouse_Action :=
     Flyology_TUI.Events.Mouse_Move;
   Modified   : Flyology_TUI.Events.Modifiers;
   Wheel_X    : Integer := 0;
   Wheel_Y    : Integer := 0;
end record;

Component-relative mouse data. Signed coordinates let a captured drag or release remain local after it leaves the component's current bounds.

Record fields
X
Y
Button
Action
Modified
Wheel_X
Wheel_Y

Localize

function Localize
  (Event : Flyology_TUI.Events.Mouse_Event;
   Item  : Region) return Flyology_TUI.Events.Mouse_Event

Translate a mouse event from terminal coordinates to Region-relative coordinates. Modifiers, button state, action, and wheel deltas survive.

Parameters
Event
Item
Return value

Localize

function Localize
  (Event : Flyology_TUI.Events.Terminal_Event;
   Item  : Region) return Flyology_TUI.Events.Terminal_Event

Localize the mouse payload of a terminal event.

Parameters
Event
Item
Return value

Region

type Region is record
   X      : Natural := 0;
   Y      : Natural := 0;
   Width  : Natural := 0;
   Height : Natural := 0;
end record;
Record fields
X
Y
Width
Height

Relative

function Relative
  (Event  : Flyology_TUI.Events.Mouse_Event;
   Origin : Flyology_TUI.Geometry.Point) return Local_Event

Translate to signed coordinates relative to an arbitrary origin. Results saturate if the mathematical difference is outside Integer.

Parameters
Event
Origin
Return value

Relative

function Relative
  (Event : Flyology_TUI.Events.Mouse_Event;
   Item  : Region) return Local_Event
Parameters
Event
Item
Return value

Relative

function Relative
  (Event  : Flyology_TUI.Events.Terminal_Event;
   Origin : Flyology_TUI.Geometry.Point) return Local_Event
Parameters
Event
Origin
Return value

Relative

function Relative
  (Event  : Local_Event;
   Origin : Flyology_TUI.Geometry.Point) return Local_Event

Relocalize an already-signed event for a nested or moving component.

Parameters
Event
Origin
Return value