@@ -650,10 +650,7 @@ def __str__(self) -> str:
650650
651651
652652class WindowEvent (Event ):
653- """
654- Attributes:
655- type (str): A window event could mean various event types.
656- """
653+ """A window event."""
657654
658655 type : Final [ # type: ignore[misc] # Narrowing final type.
659656 Literal [
@@ -675,12 +672,13 @@ class WindowEvent(Event):
675672 "WindowHitTest" ,
676673 ]
677674 ]
675+ """The current window event. This can be one of various options."""
678676
679677 @classmethod
680678 def from_sdl_event (cls , sdl_event : Any ) -> Union [WindowEvent , Undefined ]:
681679 if sdl_event .window .event not in cls .__WINDOW_TYPES :
682680 return Undefined .from_sdl_event (sdl_event )
683- event_type : Final = cls .__WINDOW_TYPES [sdl_event .window .event ]. upper ()
681+ event_type : Final = cls .__WINDOW_TYPES [sdl_event .window .event ]
684682 self : WindowEvent
685683 if sdl_event .window .event == lib .SDL_WINDOWEVENT_MOVED :
686684 self = WindowMoved (sdl_event .window .data1 , sdl_event .window .data2 )
@@ -720,12 +718,12 @@ def __repr__(self) -> str:
720718class WindowMoved (WindowEvent ):
721719 """
722720 Attributes:
723- type (str): Always "WINDOWMOVED".
724721 x (int): Movement on the x-axis.
725722 y (int): Movement on the y-axis.
726723 """
727724
728725 type : Final [Literal ["WINDOWMOVED" ]] # type: ignore[assignment,misc]
726+ """Always "WINDOWMOVED"."""
729727
730728 def __init__ (self , x : int , y : int ) -> None :
731729 super ().__init__ (None )
@@ -751,12 +749,12 @@ def __str__(self) -> str:
751749class WindowResized (WindowEvent ):
752750 """
753751 Attributes:
754- type (str): "WINDOWRESIZED" or "WINDOWSIZECHANGED"
755752 width (int): The current width of the window.
756753 height (int): The current height of the window.
757754 """
758755
759756 type : Final [Literal ["WINDOWRESIZED" , "WINDOWSIZECHANGED" ]] # type: ignore[assignment,misc]
757+ """WINDOWRESIZED" or "WINDOWSIZECHANGED"""
760758
761759 def __init__ (self , type : str , width : int , height : int ) -> None :
762760 super ().__init__ (type )
0 commit comments