![]() I got it to work with Android, and - with some caveats - with Linux. It turns out the whole HID thing isn't as standardized as I thought when reading the documentation. I'll keep looking into this, and if I find something that works, I'll let you know. Yeah, once you put your code out there, there will be people willing to abuse it. It also seems to have had some popularity with the "USB Rubber Ducky" crowd (to be clear, I don't support that usage unless it's used for legitimate pen testing). The library did work perfectly for my needs, and a friend was also successful using it for an Instagram-related project. Great, I'll look further into it, thanks. ![]() So even if my code is not useful to you, perhaps one of those links will be. I'm certain the HID approach is the right way to do it, and I share some projects that use other approaches in the readme: My main concern with this approach is speed, since you need to delay between the mouse movements so that acceleration doesn't trigger. Thank you for those ressources, pert! I thought about doing something like this as well. GitHub - per1234/MouseTo: Arduino library for moving mouse pointer to absolute screen coordinates I took a very caveman approach to working around this issue, which was to use a series of small mouse movements, and published it as an Arduino library: I had the same need to reliably and repeatably click specific locations on the screen, and had the same problem with mouse acceleration. I did a project some years ago to use an Arduino for automated bidding on eBay. Good catch! What I don't understand here is that m is normally of type uint8_t, so there is a cast from signed to unsigned which I don't understand the purpose of.īut since it's not working at all rather than truncated, I suspect the main issue lies somewhere else. The variable m in ::move will also need to be changed to int, else you will still truncate the integers to signed chars. Just passing integers will not be the only thing to change. The TX led flickers though, for what it's worth. You're right, big blunder on my side! But sadly, even 0x10 still stops all mouse functionality. ![]() Thank you sterretje for your kind words and advice!Īnd I suspect that a changing the report size to 0x16 (22 decimal) might not be supported maybe 0x10 will work better. Is it possible to do larger pointer "leaps" than +/- 127 units? Or is there a better way to do what I need?Īny help is greatly appreciated! this whole HID-thing is new to me, and I'm finding it very interesting, but also incredibly overwhelming. But I feel this should theoretically be possible, no? To void Mouse_::move(int16_t x, int16_t y, signed char wheel)Īnd while changing the minima and maxima had no effect whatsoever, changing the report_size to 16bit broke the functionality entirely, eg. I tried changing the corresponding lines in Mouse.cpp to 0x16, 0x00, 0x80, // LOGICAL_MINIMUM (-32768)Ġx26, 0xff, 0x7f, // LOGICAL_MAXIMUM (32767)Īnd the definition of void Mouse_::move(signed char x, signed char y, signed char wheel) I thought it may be possible to expand that.Īccording to the HID-Specification, the values for Logical_Minimum and Logical_Maximum can be freely chosen, as long as they fit in the given Report_Size. ![]() The problem is that as it is, you can only move a maximum of 127 units per instruction. One possible solution I can think of would be to get from point to point in one single HID-Instruction (I don't know how this is really called), so that the Mouse driver only sees one input and doesn't trigger Acceleration. Because of Mouse Acceleration, it is very difficult to do precise, repeatable movements between points on the screen. The problem I'm facing is Mouse accelereation. My goal is being able to point the cursor to multiple places on the screen and having the Leonardo repeatedly double click in all those places. So the word "pointer" will signify the Mouse-Pointer-arrow-thingy, and not a C++ *pointer. I'm trying to program an Arduino Leonardo to automate grinding a silly Android game (not for getting onto a leaderboard, don't worry).
0 Comments
Leave a Reply. |