TTkMouseEvent🌶️

class TTkMouseEvent(x: int, y: int, key: int, evt: int, mod: int, tap: int, raw: str)[source]🌶️

Bases: object

Mouse Events

Demo:

test.input.py

x: int🌶️

The horizontal (x) position relative to the widget

y: int🌶️

The vertical (y) position relative to the widget

key: MouseKey🌶️

The TTkConstant.MouseKey reported in this event (i.e. LeftButton)

mod: KeyModifier🌶️

The TTkConstant.KeyModifier used, default NoModifier

evt: MouseEvent🌶️

The TTkConstant.MouseEvent reported in this event (i.e. Press)

tap: int🌶️

The number of tap (keypressed) reported in this event, (i.e. a doubleclick is reported as tap=2)

raw: str🌶️

The terminal “raw” information reporting this event (Do not use it unless you know what you are looking for)

Methods🌶️

clone(pos=None, evt=None)[source]🌶️
evt2str()[source]🌶️
key2str()[source]🌶️
mod2str()[source]🌶️
pos() tuple[int, int][source]🌶️

Returns the position of the mouse cursor relative to the current widget.

Returns:

the position.

Return type:

tuple[int,int]

TTkMouseEvent Attributes🌶️

AllButtons

Down

Drag

LeftButton

MidButton

MiddleButton

Move

NoButton

NoEvent

Press

Release

RightButton

Up

Wheel

evt

key

mod

raw

tap

x

y