@@ -362,8 +362,8 @@ def __init__(
362362 widget : Widget | None ,
363363 x : float ,
364364 y : float ,
365- delta_x : float ,
366- delta_y : float ,
365+ delta_x : int ,
366+ delta_y : int ,
367367 button : int ,
368368 shift : bool ,
369369 meta : bool ,
@@ -399,34 +399,54 @@ def __init__(
399399
400400 @property
401401 def x (self ) -> int :
402- """The relative X coordinate."""
402+ """The relative X coordinate of the cell under the mouse ."""
403403 return int (self ._x )
404404
405405 @property
406406 def y (self ) -> int :
407- """The relative Y coordinate."""
407+ """The relative Y coordinate of the cell under the mouse ."""
408408 return int (self ._y )
409409
410410 @property
411411 def delta_x (self ) -> int :
412412 """Change in `x` since last message."""
413- return int ( self ._delta_x )
413+ return self ._delta_x
414414
415415 @property
416416 def delta_y (self ) -> int :
417417 """Change in `y` since the last message."""
418- return int ( self ._delta_y )
418+ return self ._delta_y
419419
420420 @property
421421 def screen_x (self ) -> int :
422- """X coordinate relative to top left of screen."""
422+ """X coordinate of the cell relative to top left of screen."""
423423 return int (self ._screen_x )
424424
425425 @property
426426 def screen_y (self ) -> int :
427- """Y coordinate relative to top left of screen."""
427+ """Y coordinate of the cell relative to top left of screen."""
428428 return int (self ._screen_y )
429429
430+ @property
431+ def pointer_x (self ) -> float :
432+ """The relative X coordinate of the pointer."""
433+ return self ._x
434+
435+ @property
436+ def pointer_y (self ) -> float :
437+ """The relative Y coordinate of the pointer."""
438+ return self ._y
439+
440+ @property
441+ def pointer_screen_x (self ) -> float :
442+ """The X coordinate of the pointer relative to the screen."""
443+ return self ._screen_x
444+
445+ @property
446+ def pointer_screen_y (self ) -> float :
447+ """The Y coordinate of the pointer relative to the screen."""
448+ return self ._screen_y
449+
430450 @classmethod
431451 def from_event (
432452 cls : Type [MouseEventT ], widget : Widget , event : MouseEvent
@@ -449,10 +469,12 @@ def from_event(
449469
450470 def __rich_repr__ (self ) -> rich .repr .Result :
451471 yield self .widget
452- yield "x" , self ._x
453- yield "y" , self ._y
454- yield "delta_x" , self ._delta_x , 0
455- yield "delta_y" , self ._delta_y , 0
472+ yield "x" , self .x
473+ yield "y" , self .y
474+ yield "pointer_x" , self .pointer_x
475+ yield "pointer_y" , self .pointer_y
476+ yield "delta_x" , self .delta_x , 0
477+ yield "delta_y" , self .delta_y , 0
456478 if self .screen_x != self .x :
457479 yield "screen_x" , self ._screen_x
458480 if self .screen_y != self .y :
0 commit comments