struct Tput::Mouse::Event

Overview

A single, normalized mouse event.

#x/#y are 0-based screen coordinates (column, row); the on-the-wire 1-based values have already been adjusted.

Defined in:

tput/mouse.cr

Constructors

Instance Method Summary

Constructor Detail

def self.blur(source : Symbol = :xterm) : Event #

Constructs a terminal focus-out (Action::Blur) event.


[View source]
def self.focus(source : Symbol = :xterm) : Event #

Constructs a terminal focus-in (Action::Focus) event.


[View source]
def self.new(action : Action, button : Button, x : Int32, y : Int32, shift : Bool = false, meta : Bool = false, ctrl : Bool = false, source : Symbol = :xterm, page : Int32 | Nil = nil, px : Int32 | Nil = nil, py : Int32 | Nil = nil) #

[View source]

Instance Method Detail

def action : Action #

[View source]
def action=(action : Action) #

[View source]
def button : Button #

[View source]
def button=(button : Button) #

[View source]
def ctrl=(ctrl : Bool) #

[View source]
def ctrl? : Bool #

[View source]
def focus_event? #

Whether this is a focus-gained/lost event rather than a pointer event.


[View source]
def meta=(meta : Bool) #

[View source]
def meta? : Bool #

[View source]
def page : Int32 | Nil #

Page number, only set by the DEC-locator encoding; nil otherwise.


[View source]
def page=(page : Int32 | Nil) #

Page number, only set by the DEC-locator encoding; nil otherwise.


[View source]
def px : Int32 | Nil #

Sub-cell pixel coordinates, 0-based, only set by the SGR-Pixels encoding (DEC private mode 1016); nil for every other encoding. When present, #x/#y still carry the derived cell coordinates (pixel ÷ cell size), so existing cell-based hit-testing is unaffected — a consumer wanting sub-cell precision (paint/drag over pixel graphics) reads #px/#py.


[View source]
def px=(px : Int32 | Nil) #

Sub-cell pixel coordinates, 0-based, only set by the SGR-Pixels encoding (DEC private mode 1016); nil for every other encoding. When present, #x/#y still carry the derived cell coordinates (pixel ÷ cell size), so existing cell-based hit-testing is unaffected — a consumer wanting sub-cell precision (paint/drag over pixel graphics) reads #px/#py.


[View source]
def py : Int32 | Nil #

[View source]
def py=(py : Int32 | Nil) #

[View source]
def shift=(shift : Bool) #

[View source]
def shift? : Bool #

[View source]
def source : Symbol #

Where the event originated: :xterm for sequences parsed from the input stream, other producers (e.g. :gpm) set their own tag. Informational only.


[View source]
def source=(source : Symbol) #

Where the event originated: :xterm for sequences parsed from the input stream, other producers (e.g. :gpm) set their own tag. Informational only.


[View source]
def x : Int32 #

[View source]
def x=(x : Int32) #

[View source]
def y : Int32 #

[View source]
def y=(y : Int32) #

[View source]