File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1655,6 +1655,14 @@ def scancode(self) -> "Scancode":
16551655 """
16561656 return self
16571657
1658+ def __eq__ (self , other : Any ) -> bool :
1659+ if isinstance (other , KeySym ):
1660+ raise TypeError (
1661+ "Scancode and KeySym enums can not be compared directly."
1662+ " Convert one or the other to the same type."
1663+ )
1664+ return super ().__eq__ (other )
1665+
16581666
16591667class KeySym (enum .IntEnum ):
16601668 """Key syms
@@ -2182,6 +2190,14 @@ def scancode(self) -> Scancode:
21822190 """
21832191 return Scancode (lib .SDL_GetScancodeFromKey (self .value ))
21842192
2193+ def __eq__ (self , other : Any ) -> bool :
2194+ if isinstance (other , Scancode ):
2195+ raise TypeError (
2196+ "Scancode and KeySym enums can not be compared directly."
2197+ " Convert one or the other to the same type."
2198+ )
2199+ return super ().__eq__ (other )
2200+
21852201
21862202__all__ = [ # noqa: F405
21872203 "Modifier" ,
You can’t perform that action at this time.
0 commit comments