struct Tessell::Kit::Event

Defined in:

tessell/kit/events.cr

Constructors

Instance Method Summary

Constructor Detail

def self.blur : Event #

[View source]
def self.focus : Event #

[View source]
def self.key_down(key : Key, modifiers : Modifiers = Modifiers.none) : Event #

[View source]
def self.key_up(key : Key, modifiers : Modifiers = Modifiers.none) : Event #

[View source]
def self.new(kind : Kind, x : Float32 = 0.0_f32, y : Float32 = 0.0_f32, button : Int32 = 0, key : Key | Nil = nil, text : String | Nil = nil, modifiers : Modifiers = Modifiers.none, wheel_dx : Float32 = 0.0_f32, wheel_dy : Float32 = 0.0_f32, click_count : Int32 = 1, timestamp_ms : Int64 = 0_i64, repeat : Bool = false, drag_distance : Float32 = 0.0_f32) #

[View source]
def self.pointer(kind : Kind, x : Float32, y : Float32, button : Int32 = 0, modifiers : Modifiers = Modifiers.none) : Event #

[View source]
def self.text_input(text : String, modifiers : Modifiers = Modifiers.none) : Event #

[View source]
def self.wheel(x : Float32, y : Float32, dx : Float32, dy : Float32, modifiers : Modifiers = Modifiers.none) : Event #

[View source]

Instance Method Detail

def alt? : Bool #

[View source]
def button : Int32 #

[View source]
def click_count : Int32 #

输入语义透传(issue #20):组件只看 Event 即可判定单击/双击与 按住重复,不必自存时间戳或反向拿 Root/Router。 click_count:PointerUp 有效——1=单击,2=双击(同目标、时间窗、位移 上限内);其他 kind 恒为 1。0 表示非点击。


[View source]
def ctrl? : Bool #

[View source]
def drag_distance : Float32 #

按下到释放的位移(PointerUp 有效),拖选与点击区分用。


[View source]
def key : Key | Nil #

[View source]
def kind : Kind #

[View source]
def meta? : Bool #

[View source]
def modifiers : Modifiers #

[View source]
def repeat : Bool #

[View source]
def shift? : Bool #

[View source]
def text : String | Nil #

[View source]
def timestamp_ms : Int64 #

[View source]
def wheel_dx : Float32 #

[View source]
def wheel_dy : Float32 #

[View source]
def x : Float32 #

[View source]
def y : Float32 #

[View source]