struct
Tessell::Kit::Event
- Tessell::Kit::Event
- Struct
- Value
- Object
Defined in:
tessell/kit/events.crConstructors
- .blur : Event
- .focus : Event
- .key_down(key : Key, modifiers : Modifiers = Modifiers.none) : Event
- .key_up(key : Key, modifiers : Modifiers = Modifiers.none) : Event
- .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)
- .pointer(kind : Kind, x : Float32, y : Float32, button : Int32 = 0, modifiers : Modifiers = Modifiers.none) : Event
- .text_input(text : String, modifiers : Modifiers = Modifiers.none) : Event
- .wheel(x : Float32, y : Float32, dx : Float32, dy : Float32, modifiers : Modifiers = Modifiers.none) : Event
Instance Method Summary
- #alt? : Bool
- #button : Int32
-
#click_count : Int32
输入语义透传(issue #20):组件只看 Event 即可判定单击/双击与 按住重复,不必自存时间戳或反向拿 Root/Router。 click_count:PointerUp 有效——1=单击,2=双击(同目标、时间窗、位移 上限内);其他 kind 恒为 1。0 表示非点击。
- #ctrl? : Bool
-
#drag_distance : Float32
按下到释放的位移(PointerUp 有效),拖选与点击区分用。
- #key : Key | Nil
- #kind : Kind
- #meta? : Bool
- #modifiers : Modifiers
- #repeat : Bool
- #shift? : Bool
- #text : String | Nil
- #timestamp_ms : Int64
- #wheel_dx : Float32
- #wheel_dy : Float32
- #x : Float32
- #y : Float32
Constructor Detail
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)
#
def self.pointer(kind : Kind, x : Float32, y : Float32, button : Int32 = 0, modifiers : Modifiers = Modifiers.none) : Event
#
def self.wheel(x : Float32, y : Float32, dx : Float32, dy : Float32, modifiers : Modifiers = Modifiers.none) : Event
#
Instance Method Detail
def click_count : Int32
#
输入语义透传(issue #20):组件只看 Event 即可判定单击/双击与 按住重复,不必自存时间戳或反向拿 Root/Router。 click_count:PointerUp 有效——1=单击,2=双击(同目标、时间窗、位移 上限内);其他 kind 恒为 1。0 表示非点击。