Esempio n. 1
0
    def send_string(s):
        """Send string to game"""
        for c in str(s):
            # UnityEngine.UI.InputField
            vkc = win32api.VkKeyScan(c)
            win32gui.PostMessage(Window.id, wcon.WM_KEYDOWN, vkc, 0)

            # UnityEngine.Input.GetKeyDownInt
            # https://github.com/jamesjlinden/unity-decompiled/blob/master/UnityEngine/UnityEngine/KeyCode.cs
            # Unity"s keycodes matches with ascii
            Com.shortcut(ord(c))
            time.sleep(userset.SHORT_SLEEP)
Esempio n. 2
0
 def send_arrow_press(a: str = "left") -> None:
     """Sends either a left, right, up or down arrow key press"""
     key = Inputs.Arrow[a]
     Com.shortcut(key)
     time.sleep(userset.SHORT_SLEEP)