You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When we use Macros its hard to be really useful - e,g. drawing a circle or clicking on screen elements, because mouse is only relative. It needs to be absolute to be useful
Describe the solution you'd like
An option - I'm not sure where - that the mouse is set to be absolute rather than relative. It needs to be not the default - it can go wrong if you use this with a different screen resolution to what the user is used to
Describe alternatives you've considered
Software on the recieving device to change relative to absolute. This wouldnt work for iOS/Android
So heres the thinking. It's possible to accumulate the relative movements internally to maintain an accurate tally of the position, essentially creating a virtual absolute coordinate system. This method wouldn't require you to know the physical screen size but rather work within a predefined coordinate space. Here's how it could work:
Change the HID Report Descriptor: Alter the HID report descriptor on the nRF52840 to indicate that it's sending absolute coordinate data.
Accumulate Movements: Implement firmware to accumulate the relative movements from the mouse. As the mouse sends its relative movements, the firmware would add these to a running total, which represents the current position in your virtual coordinate space.
// Global variables for absolute positioningintabsolute_x=0;
intabsolute_y=0;
intscreen_width=800; // Adjust as per your screen resolution NB: I wonder whether we can set this via serial command once per session. I'd ideally like to not have to give these dimensions. how does the desktophop thing do it?intscreen_height=600; // Adjust as per your screen resolutionvoidsendBLEMouseMove(char*line) {
// ... existing code ...// Convert relative movements to absolutex+=strtol(p, NULL, 10); // Accumulate the x movementy+=strtol(p, NULL, 10); // Accumulate the y movement// Clamp the values to the screen sizeif (x<0) x=0;
if (y<0) y=0;
if (x>screen_width) x=screen_width;
if (y>screen_height) y=screen_height;
// Update the global absolute positionabsolute_x=x;
absolute_y=y;
// ... existing code to send the movement ...
}
boolabsolute_mode= false; // Default to relative modevoidtoggleAbsoluteMode() {
absolute_mode= !absolute_mode;
if (absolute_mode) {
// Reset the position to the center of the screen or a known positionabsolute_x=screen_width / 2;
absolute_y=screen_height / 2;
}
}
Is your feature request related to a problem? Please describe.
When we use Macros its hard to be really useful - e,g. drawing a circle or clicking on screen elements, because mouse is only relative. It needs to be absolute to be useful
Describe the solution you'd like
An option - I'm not sure where - that the mouse is set to be absolute rather than relative. It needs to be not the default - it can go wrong if you use this with a different screen resolution to what the user is used to
Describe alternatives you've considered
Software on the recieving device to change relative to absolute. This wouldnt work for iOS/Android
**NB: See this for inspiration. Look at the readme and mouse section - https://github.com/hrvach/deskhop) **
So heres the thinking. It's possible to accumulate the relative movements internally to maintain an accurate tally of the position, essentially creating a virtual absolute coordinate system. This method wouldn't require you to know the physical screen size but rather work within a predefined coordinate space. Here's how it could work:
Change the HID Report Descriptor: Alter the HID report descriptor on the nRF52840 to indicate that it's sending absolute coordinate data.
Accumulate Movements: Implement firmware to accumulate the relative movements from the mouse. As the mouse sends its relative movements, the firmware would add these to a running total, which represents the current position in your virtual coordinate space.
I havent read the code of deskhop very well but I imagine its doing something like this in the code - maybe in the mouse section https://github.com/hrvach/deskhop/tree/main/src
The text was updated successfully, but these errors were encountered: