Giter VIP home page Giter VIP logo

pydirectinput_rgx's People

Contributors

agade09 avatar cetteup avatar learncodebygaming avatar reggx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pydirectinput_rgx's Issues

duration parameter doesn't work as expected

Methods like move(), moveTo() and moveRel() have duration param, which doesn't seem to work correctly. Whenever it is set to 0, then the cursor is moved immediately, but whenever I pass any value to it, it always moves in the same fast way. What is more, whenever the cursor is close to the edge of the screen, the duration parameter starts to be respected and the cursor just moves to the planned direction for the given amount of duration seconds.

Windows 10, tried Python 3.7 and 3.11

Please, tell me if I can provide you more info about my system, thanks

This library seems to interfere with pyautogui

Even just importing press from pydirectinput_rgx or core pydirectinput from @learncodebygaming like in the following example:

from pydirectinput import press

import pyautogui
pyautogui.moveTo(1, 5, 0)

causes:

Traceback (most recent call last):
  File "C:\Users\admin\Desktop\pyautogui_test.py", line 6, in <module>
    pyautogui.moveTo(1, 5, 0)
  File "C:\Program Files\Python\Lib\site-packages\pyautogui\__init__.py", line 593, in wrapper
    failSafeCheck()
  File "C:\Program Files\Python\Lib\site-packages\pyautogui\__init__.py", line 1733, in failSafeCheck
    if FAILSAFE and tuple(position()) in FAILSAFE_POINTS:
                          ^^^^^^^^^^
  File "C:\Program Files\Python\Lib\site-packages\pyautogui\__init__.py", line 767, in position
    posx, posy = platformModule._position()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python\Lib\site-packages\pyautogui\_pyautogui_win.py", line 344, in _position
    ctypes.windll.user32.GetCursorPos(ctypes.byref(cursor))
ctypes.ArgumentError: argument 1: TypeError: expected LP__POINT instance instead of pointer to POINT

Apparently years ago this was a bug in pyautogui (pywinauto/pywinauto#788), but according to the issue ticket it was fixed, somehow importing pydirectinput_rgx in that specific way "unfixes" it and I'm not sure why.

using py pyautogui Version: 0.9.54 and pydirectinput_rgx Version: 2.0.7 on python 3.11.2 with Windows 11 - x64 bit

Edit: According to this issue moses-palmer/pystray#93 (comment) you need to create a new instance of windll or something ๐Ÿคท๐Ÿผ

write() doesn't recognise shifted characters

write() doesn't recognise shifted characters.
if you need to write ABCD or !@#$, you're supposed to make your own def with like:

def key_write(text, delay=default_delay):
    for each in text:
        key_press_for_write(each, timer=0.02, delay=0)
    time.sleep(delay)

def key_press_for_write(key, timer=0.1, delay=default_delay):
    shift_flag = False
    if key in "~!@#$%^&*()_+" or string.isupper(key):
        shift_flag = True
    if shift_flag:
        hold_shift(0)
    key_down(key, 0)
    time.sleep(timer)
    key_up(key, 0)
    if shift_flag:
        unhold_shift(0)
    time.sleep(delay)

(some methods are customised for my personal uses, but I am sure you can recognise what these are for)

No mouse clicks in games using Unity

Hello,

I would like to have some feedback on the following questions:

  • are there any known specifically designed features in PC games to prevent mouse clicks via scripting and thus avoid botting ?
  • any methods to identify such features (other than trying some PyAutoGUI / PyDirectInput / PyDirectInput -RGX code) for example by scanning the game's installation directory with some sort of tool ?
  • and most importantly are there any ways to circumvent such measures and still do automatic stuff whatever the programming language ?

All these questions because I've tried some quick examples and never got the primary / left clicks working with Python 3.11.2 on Windows 10. Running the code with admin privileges did not help. The examples (mouse moves and clicks) worked fine for everything but games with either PyAutoGUI, PyDirectInput and PyDirectInput-RGX.

Thanks and regards,
Mac

User error or bug re: move (relative mouse movement)?

Hi thanks so much for your work updating pydirectinput and I was excited to find it on PyPi.

I submitted a PR to this project, wingman-ai, to implement pydirectinput-rgx (pyautogui is still used in the alternative for mac users of the project), and encountered unexpected behavior with relative mouse movement. Wondering if this is user error or a bug.

You can see the most recent PR here: ShipBit/wingman-ai@3569bff

I was having an issue where using the move(x,y) or move(x,y,duration=[duration]) functions were not using relative movement. If, for example, the current mouse position was 900,600, and x,y was 0, 100, the cursor would move to 0,100 not 900,700. I tested by running print statements of the current mouse position (position()), ensuring x, y were integers, and then printing the final mouse postion, and with 0,-100; 100,0; -100,0; 0,100 and each had the same issue when running move(x,y) or move(x,y,duration) with putting the cursor up at the top left corner of the screen with various offsets. I also tried setting duration to 0.5, 1, and 2 and although I could see the cursor moving slower, it still went to the same place.

As you can see in the PR, I reverted by calculating a new absolute position manually and then using the moveTo function instead, and that works fine.

Is this a bug or user error? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.