1818from __future__ import annotations
1919
2020from ..utils import keys_to_typing
21- from .interaction import KEY , POINTER , WHEEL , Interaction
21+ from .interaction import KEY , Interaction
2222from .key_input import KeyInput
2323from .pointer_input import PointerInput
2424from .wheel_input import WheelInput
@@ -29,18 +29,7 @@ def __init__(self, source: KeyInput | PointerInput | WheelInput | None = None) -
2929 if source is None :
3030 source = KeyInput (KEY )
3131 self .input_source = source
32-
33- # Determine the correct source type string based on the input object
34- if isinstance (source , KeyInput ):
35- source_type = KEY
36- elif isinstance (source , PointerInput ):
37- source_type = POINTER
38- elif isinstance (source , WheelInput ):
39- source_type = WHEEL
40- else :
41- source_type = KEY
42-
43- super ().__init__ (source_type )
32+ super ().__init__ (source )
4433
4534 def key_down (self , letter : str ) -> KeyActions :
4635 return self ._key_action ("create_key_down" , letter )
@@ -60,6 +49,6 @@ def send_keys(self, text: str | list) -> KeyActions:
6049 return self
6150
6251 def _key_action (self , action : str , letter ) -> KeyActions :
63- meth = getattr (self .input_source , action )
52+ meth = getattr (self .source , action )
6453 meth (letter )
6554 return self
0 commit comments