diff --git a/gameio.py b/gameio.py index c18a035..4b0602e 100644 --- a/gameio.py +++ b/gameio.py @@ -27,20 +27,17 @@ class AbstractGameIO(ABC): # feel free to change these two functions in the descendants - @abstractmethod def key_up(self, key: str): """Holds a key on a virtual keyboard.""" pyautogui.keyUp(key) - @abstractmethod def key_down(self, key: str): """Lets go of a key on a virtual keyboard.""" pyautogui.keyDown(key) def send_key(self, key: str): """Presses a key on a virtual keyboard.""" - self.key_up(key) - self.key_down(key) + pyautogui.press(key) class WindowsGameIO(AbstractGameIO): @@ -51,12 +48,6 @@ class WindowsGameIO(AbstractGameIO): def fetch_sshot(self): return self.d.screenshot() # TODO: Cut this to self.loc(x, y, w, h) - def key_up(self, key: str): - pyautogui.keyUp(key) - - def key_down(self, key: str): - pyautogui.keyDown(key) - class LinuxGameIO(AbstractGameIO): def __init__(self):