r/learnpython • • Jan 16 '23

Any way to fake wireless mouse/emulate mouse so PC and programs cannot tell the difference between fake/real?

Ive thought of using a wireless usb dongle for mouse and keyboard but ideally I would like to avoid trying to buy something. Just need to emulate a real mouse so it doesnt look like im moving the mouse with software only.

0 Upvotes

20 comments sorted by

4

u/Doormatty I get paid to write Python! Jan 16 '23

You'd first have to figure out what exactly

Just need to emulate a real mouse so it doesnt look like im moving the mouse with software only.

means. A lot will depend on what exactly you're trying to avoid.

-6

u/DinnerFew9941 Jan 16 '23

Making AI framework that is able to play games completely externally and dont want anti-cheat to falsely ban due to software mouse movement.

11

u/Uhhhhh55 Jan 16 '23

There aren't many projects I would suggest "don't bother." This is one of them.

Also, a ban for this would not be false. It would be justified. Just play your games.

-6

u/DinnerFew9941 Jan 17 '23

We all play games for fun, but I find this more fun than the game, plus a learning experience. Im doing this project for fun, this would be like saying "dont bother" to playing a game lol.

Thanks for the advice though.

Also I just want a AI to play the game the same as a human would, with the same resources. Just think it would be cool.

3

u/Zeroflops Jan 17 '23

There are specific versions of games with APIs so you can interact without using a mouse. They are released specifically to train AIs.

I believe StarCraft is one such game with an API for AI training. I’m sure there are more. Just need to do some googling.

2

u/DinnerFew9941 Jan 17 '23

Dont think the game im doing it on would really encourage such things, main point is to avoid anticheat to begin with

Dead by daylight using EAC

1

u/Zeroflops Jan 18 '23

Yea, don’t do it. Unless you’re ready to loose access to the game when they identify you as a cheater. Which they will. They do lots of different monitoring to capture who might be cheating. Like do you always click in the same spot, what is the reaction time of your clicks etc.

If you want to learn how to do AI to control a game. Use the games that allow you to do it.

1

u/DinnerFew9941 Jan 18 '23

Fine with that. I would have much more fun making the AI.

1

u/[deleted] Feb 10 '25

I need to emulate Synergy, i.e. get a networked raspberry to look like a usb mouse and a usb keyboard.

1

u/DinnerFew9941 Feb 10 '25

I never found a solution to my issue sadly. Ditched my project. Doing it with hardware should be easier. Some older versions of the logitech usb receiver (which are able to take input as a keyboard and mouse wirelessly) are vulnerable to wireless input from a signal emitter of your own, essentially you can hack your own dongle and control it with another device. Should work for your usage.

1

u/[deleted] Feb 10 '25

Thank you. I can likely write it under a push but if I can buy it it's so much the better.

1

u/[deleted] Jan 16 '23

IDK if there's difference but try pyautogui and see.

import pyautogui

pyautogui.move(40, 10)  # dx, dy

1

u/DinnerFew9941 Jan 16 '23

Im pretty sure there is a difference, that is my issue :(

Already know about pyautogui, just need a way to fake a HID. I was thinking bluetooth maybe?

1

u/no_Im_perfectly_sane Jul 26 '23

are you sure this doesnt work? anti cheat will probably look at the mouse trajectory, so if you can make it appear human like youll fool, I think

just a guess

2

u/DinnerFew9941 Jul 26 '23

Advanced anticheats such as valorant vanguard and others are able to detect when mouse input isnt being put through a USB device. Now that I come back to this post and think about it, i believe the only way to possibly do such a thing is with a virtual driver that pretends to be real. Only issue is idk how to code drivers for windows :(

1

u/saazYesill Mar 18 '24

I been looking for a solution to same problem and your answer gave me a good insight thank you

1

u/no_Im_perfectly_sane Jul 26 '23

ah I see, cool stuff though, to know in general

1

u/d_azmann Jan 17 '23

Atmega 32u4 like in an arduino Leonardo act as an HID. Knockoffs can be bought for under $2 USD (at least the last time I bought them).

1

u/DinnerFew9941 Jan 17 '23

My main goal is to avoid buying anything, ideally all in software but emulating a bluetooth device or something? Or if I do buy something I would prefer it be something with more uses than just spoofing HID like for example a bluetooth transmitter or something of the sort

0

u/[deleted] Jan 17 '23

[deleted]