Help with Mouse HID with very low latency for PC game control

Greetings! I would like to introduce myself as a newbie to the micro-controller world with the intention of learning. I am thinking of making a arduino based macro or automation tool for strategy games and general office use.

The intention is to configure a Arduino as a HID Device most likely a Mouse via the Mouse library (https://www.arduino.cc/reference/en/language/functions/usb/mouse/) and send serial command to it via the Serial library to do certain tasks such as clicking a button on a UI or moving the mouse in a square only when a client side script, in python send the Arduino a special letter. The idea is to program the arduino with pre-set mouse macros in functions and make it listen to the serial port so when a client side script sends it a command like the letter (C) it will execute the a function associated with this special character which will move the mouse in a special way.

NOTE (I would like to make the mouse moves accurate up to a millisecond, therefor a side question is that is the delay() command in the arduino environment accurate up to a millisecond)

I have over the few days learned some Arduino Code and i believe this will work, Please Note I HAVE NOT YET BOUGHT an Arduino.

I would like some advice if this project is feasible and which Arduino Mode is best suited for this purpose? (i was think of a Leonardo) and can i achieve millisecond accuracy with the delay() method in arduino?

I would like to make the mouse moves accurate up to a millisecond, therefor a side question is that is the delay() command in the arduino environment accurate up to a millisecond)

I don't see that as a question.

I asked it because on other operating systems such as windows the Sleep() function is accurate up to only 15 milliseconds which did cause me a few problems before. That is why i was wonder about the Arduino's accuracy in its sleep implementation.

There's no operating system - if delay isn't accurate enough, there's always delayMicroseconds

Ok thanks about that how about the rest of the project is it feasible?

I am not familiar with using an Arduino for HID however I reckon your title won't be noticed by people who may be able to help. It seems to me that something like the following title would more accurately reflect your problem

Help with Mouse HID with very low latency for PC game control

If you edit your Original Post you can change the title.

I presume you are aware that the mouse and keyboard functions only work on some Arduinos.

...R

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html .

Thanks… Tom… :slight_smile: