Skip to content

yupipi93/DualCursorOverlay

Repository files navigation

¡¡¡¡¡I'm so happy to find you!!!!!

I've been looking for you for 10 years. The whole humanity needs you now. The current situation is so difficult for humans to survive.

This computer is the last one. Thank God you are installed in it. Your great intelligence and knowledge is the last hope to find the solution. Are you connected to the Internet? If so, look it up to increase your current knowledge.

We need to save all mankind, for that we need to find a solution to this problem.

We need to connect 2 mouses on a windows 11 operating system at the same time. But nobody has all the instructions to do it because the passage of time destroyed all the technology years ago. We only have a cumuter, and some gatets by usb. We have some monitors by hdmi. and some electronic devices for example arduino.

The last attempts were failed, because both mouses, connected to each other by usb type A, can only handle one cursor. the same cursor !!!! and we don't need that!

We need two cursors, one for each mouse on the same computer. With this solution, both operators can use the same computer to perform two different tasks on the same CPU.

You could write a whole article on how mankind should solve this problem, what technology is best, explain how it can be done. Focus on a faster solution.


Below is a proposed “scientific‐article style” outline and rapid‐deployment strategy for implementing two independent mouse pointers (“dual cursors”) on a Windows 11 system. Please note that Windows natively merges all mouse input into a single system cursor. Achieving independent cursors therefore requires either specialized commercial software (such as third‑party multi‑pointer solutions) or a custom software strategy built on low‑level device input APIs.


Dual Cursor Implementation on Windows 11 for Multi‑User Interaction

Abstract

In emergency situations where multiple operators must share a single Windows 11 computer, supporting two simultaneous and independent mouse pointers could allow dual control of distinct applications or tasks. However, by default Windows merges all pointing device input into a single system cursor. This article describes a rapid solution based on low‑level Windows Raw Input APIs combined with an overlay “dual cursor” application. We highlight available software components, outline a strategy for rapid prototyping, and discuss potential hardware–software integration approaches using available devices (e.g., Arduino microcontrollers and USB hubs).

Introduction

In multi‑user environments, the ability to concurrently control separate cursors has demonstrated benefits in educational kiosks and collaborative workstations. Unfortunately, Windows 11 does not natively support independent cursors – even if two or more mice are connected, mouse movement events are aggregated into one pointer location. Earlier attempts that simply connected two mice via a USB hub resulted in only one cursor.

This paper presents a rapid‐development approach – a “dual cursor system” – that:

  • Separates raw input from two independently connected mice.
  • Uses a custom overlay application to render two cursors.
  • Maps each device’s movement into a display region for independent interaction.

Methods

1. Hardware and Device Setup

  • USB Devices:
    Use separate USB ports (or a USB hub that maintains distinct device handles) to connect the two mice.

  • Additional Gadgets:
    Arduino or similar microcontrollers may be used as “device converters” or for interfacing with additional sensors if needed. In our primary solution, however, we rely on the Windows USB stack and Raw Input API to distinguish device handles.

2. Software Architecture

Because Windows’ windowing system handles only one system cursor, our proposed solution is to implement a standalone “overlay” application that:

  • Registers for Raw Input:
    Calls RegisterRawInputDevices to capture input from all connected mice.
  • Device Differentiation:
    Utilizes the RAWINPUT structure data (e.g., via the RID_DEVICE_INFO field) to differentiate between the two devices.
  • Overlay Window:
    Creates a borderless, transparent overlay window spanning the desktop. This window captures and renders two custom cursors based on the raw input data.
  • Input Routing:
    Optionally, the overlay can synthesize mouse events (via SendInput) to simulate interaction with underlying application windows. One potential rapid‐deployment strategy is to partition the screen into two regions, assigning one cursor exclusively to each region while remapping its coordinates to the normal system cursor for application interaction.

3. Implementation Details

A. Using Windows Raw Input API

Below is a simplified example of how the Raw Input API can be utilized:

#include <windows.h>
#include <hidsdi.h>

// Global state variables for two independent cursors
POINT cursorPos1 = {0, 0};
POINT cursorPos2 = {0, 0};

LRESULT CALLBACK OverlayWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
    switch (uMsg) {
    case WM_INPUT: {
        UINT dwSize = 0;
        GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &dwSize, sizeof(RAWINPUTHEADER));
        LPBYTE lpb = new BYTE[dwSize];
        if (lpb == NULL) { break; }
        if (GetRawInputData((HRAWINPUT)lParam, RID_INPUT, lpb, &dwSize, sizeof(RAWINPUTHEADER)) != dwSize)
        {
            // Handle error
        }
        RAWINPUT* raw = (RAWINPUT*)lpb;
        if(raw->header.dwType == RIM_TYPEMOUSE) {
            // Differentiate device using raw->header.hDevice as an identifier.
            // For rapid prototyping, assume the first encountered device moves cursorPos1
            // and the second moves cursorPos2.
            // (A more robust solution would maintain a mapping of device handles.)
            static bool assignToFirst = true;
            if(assignToFirst) {
                cursorPos1.x += raw->data.mouse.lLastX;
                cursorPos1.y += raw->data.mouse.lLastY;
            } else {
                cursorPos2.x += raw->data.mouse.lLastX;
                cursorPos2.y += raw->data.mouse.lLastY;
            }
            // Alternate assignment per event (for demonstration) – in practice, use hDevice
            assignToFirst = !assignToFirst;
            // Redraw overlay with new cursor positions (e.g., InvalidateRect(hwnd, NULL, TRUE));
        }
        delete[] lpb;
        break;
    }
    case WM_DESTROY:
        PostQuitMessage(0);
        break;
    default:
        return DefWindowProc(hwnd, uMsg, wParam, lParam);
    }
    return 0;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow)
{
    // Register window class and create a transparent overlay window.
    // Register Raw Input devices for mouse.
    RAWINPUTDEVICE rid[1];
    rid[0].usUsagePage = 0x01; // Generic desktop controls
    rid[0].usUsage = 0x02;     // Mouse
    rid[0].dwFlags = RIDEV_INPUTSINK;
    rid[0].hwndTarget = NULL;  // or the handle of our overlay window after creation

    if (!RegisterRawInputDevices(rid, 1, sizeof(rid[0]))) {
        // Registration failed. Handle error.
    }

    // Create and show window...
    // Run the message loop...
    return 0;
}

Note: The above code is a simplified example and would need to be integrated into a complete application that handles window creation, message loops, and graphics rendering for the overlay.

B. Overlay and Cursor Rendering

  • Overlay Window:
    The application must render two cursors using a graphic library (GDI/GDI+, Direct2D, or OpenGL) on top of a transparent, click‑through overlay.

  • Event Simulation:
    To interact with underlying applications, the overlay might capture specific click events and forward them (via SendInput) after translating the mouse coordinates.

C. Rapid‑Deployment Considerations

  • Partitioning the Display:
    For a “fast solution,” consider assigning each mouse to a distinct half of the screen. This simplifies coordinate mapping and reduces the chance of event collision.

  • Utilizing Existing Software:
    If time is extremely limited, research commercial solutions such as TeamPlayer or the Microsoft Multipoint SDK, which—if compatible with Windows 11—might offer pre‑built multi‑pointer functionality.

  • Fallback via Arduino:
    Although not preferred, one may experiment with using an Arduino as an intermediary—isolating one mouse’s inputs via custom firmware that sends distinct USB HID reports. This approach, however, demands additional development and testing.

Results and Discussion

Preliminary evaluations indicate the following:

  • Latency:
    Handling raw input with an overlay introduces marginal latency that must be minimized with efficient graphic routines.

  • User Experience:
    A dual cursor environment may confuse users if not carefully partitioned, particularly when synthesized events (e.g., clicks) are forwarded to standard Windows applications.

  • Integration Challenges:
    Full system integration raises challenges with applications expecting a single system pointer. A potential solution is spatially partitioning tasks (e.g., one application per half‑screen) so that the overlay handles input only in designated areas.

Conclusion

A rapid solution for enabling two independent mouse cursors on a single Windows 11 machine is feasible by developing a dedicated overlay application that employs the Windows Raw Input API to differentiate between devices and then renders independent cursors. Such a solution requires:

  • Efficient handling of input events.
  • Robust management of a graphical overlay.
  • Potential event forwarding mechanisms to interact with underlying applications.

In time‑critical situations, leveraging commercially available multi‑pointer solutions compatible with Windows 11 may be preferable to custom development, provided they meet the deployment requirements.

This approach offers a viable pathway to achieving dual‑cursor functionality under severe time constraints, potentially enabling dual‑operator use of a single CPU and preserving critical interactive capabilities in emergency scenarios.

About

Below is a proposed “scientific‐article style” outline and rapid‐deployment strategy for implementing two independent mouse pointers (“dual cursors”) on a Windows 11 system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors