none
How To Have Multi Cursors in windows? RRS feed

  • Question

  • Hello,

    I have multi mice that connected to one PC(with the Windows OS), I want to have a Cursor for each one of them.

    Is this possible? If it is, how can I do that and which language is best to write the program? Can I do this with c#?

    thanks.


    Monday, July 15, 2013 9:36 AM

Answers

  • The SDK is only for Applicationts and the one example I could run without having Office 2007 installed used fullscreen. And I could not work with it, as it failed to detect my PS/2 Touchpad and did not work properly with my USB Trackball either.
    You need to write a Fullscreen App that takes in the "normal" Desktop Graphics output underneath it and draws the extra mouse cursor(s) over it. (Or you can draw directly over the Desktop?). It would propably collide (and go to background) whenever something else enters fullscreen.

    "At them same time" is relative. For users it is impossible to ever click at the same time, one will always come first. The event queue processes events one after the other no matter how close they were:

    Mouse A Clicks on Pixel XY
    Makes the real cursor invisible and repalces it with a dummy-graphic.
    Move the Mousecursor to Postion of A's Click.
    Click
    Return it to the starting point, disable the dummy graphic and make it visible again.

    Mouse B Clicks on Pixel AB
    Makes the real cursor invisible and repalces it with a dummy-graphic.
    Move the Mousecursor to Postion of B's Click.
    Click
    Return it to the starting point, disable the dummy graphic and make it visible again.

    Holding the Mouse Button (especially Dragging something) is the problematic part. The other mouse's Graphics could still move, but obviously they  can't interact with Desktop UI as long as the Drag applies.

    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.

    Tuesday, July 16, 2013 10:33 AM

All replies

  • There is only one mouse Cursor. All Mouses connected to the computer move that one. Most obvious examples are Laptops, wich have a built in MousePad and can have 1 or more mouses connected via USB. Indeed I have a MousePad and Trackball (Human Interface Device wich works like a Mouse), though the Touchpad is usally disabeled (to easy to hit when typing and not nessesary).

    There is Multitouch but this is not about having more then one cursor, but having a wider range of things (gestures) to detect beside "Move Cursor" and MouseClick.


    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.

    Monday, July 15, 2013 10:15 AM
  • thanks for answering.

    So there is only one mouse, how did the "MultiMouse" application works?

    this app uses the remote connection, many of user connects to a Host PC and then the host creates Mouse Pointers for each one of users.

    how can i do some thing like that?

    its the address of multi mouse website: www.MultiMouse.com

    I used raw input to draw My Cursors for each one of mice that connected to PC, although I Used Hooks for Reading mouse movement in another project.

    but RawInput Was very slow for rendering each mice data (after moving mouse it moves my cursor for itself for many seconds after stopping mouse , but i easily get the mice handler).

    and with the hooks i couldn't get the mice handler so i couldn't draw my cursor for each mouse.

    i need something better than these two ways, i need something to be realtime and easy to find which mouse is moving(i need find the mouse handler )

    and sorry if my sentences have wrong words or something, my  English is not well...

    Monday, July 15, 2013 10:46 AM
  • Best quess:

    It does not make any more mouses. It fakes having more then one mouse.

    The mouse actions from all users are executed sequentially (so no ones action can overlap with another ones). The moment it needs to excute some users action it uses the actuall Host PC Mouse for that.

    It has full control over what the users see of the Host PC, so it can draw as many cursors as it likes. There is still going to be only one Cursor on the Host PC. Because windows does not support more then one MouseCursor or more then one Window having keyboard Focus.


    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.

    Monday, July 15, 2013 12:22 PM
  • You can have multiple mouse devices connected to your PC, and, in code, you can tell them apart.  But the Windows operating system will only display one mouse pointer -- all pointer devices connected to the system will move that same pointer.

    But, you can write your own software (let's say, for example, a full-screen Direct3D game) in which you render multiple mouse pointers manually, each one corresponding to a different physical mouse device.  One could use the RAW Input API to distinguish between Human Interface Devices (HIDs) (e..g: multiple mice, keyboards, etc.)

    There are other ways of getting this to work, but you have to use/write special software do it -- the operating system doesn't do this on its own.  Read this article to see some other examples.

    Monday, July 15, 2013 12:58 PM
  • thanks to both of you for answering my question.

    yes christopher you right and i want to try that, is there a way to get each mice handle in hooks? i used a sample hook project for get mouse position and buttons, i googled about getting mouse handle in hooks but i didn't get anything useful, maybe i need search for something else? can you tell me what i must search for?

    and another thing is how can i read mouse with hooks but force the windows to do nothing till i want? i mean the hook callback method  reads the mouse then set global mouse cursor to freeze and i move my cursors instead?

    Dear Wyck, I've already read that article before, and like i said earlier i have wrote a program that creates cursors for each mice that connected to the PC via RawInput, But (I don't know why?) it is too slow...

    Monday, July 15, 2013 2:29 PM
  • 1+2. You need to intercept raw mouse input from the actuall device. I never used hooks, but afaik they start on the OS level wich is a bit to far for your requirements.

    You don't don't freeze the globale mosue cursor. You make it in visible and have to use it for all actions of the "virtual" mouse cursors that have any effect on the Desktop. You only ever have that one (invisible) cursor to affect the applications, the start menu, drag windows, etc.

    The other mouse cursors are smoke and mirrors. You can't for example do anything interactive (like click or drag) with one mouse, while the other does something interactive (like click or drag). You can still move them (though you might run into issues with tooltips and other mouse-over related thing).

    Edit: You noticed that in the demo animation for Multimouse, only one user was actually interacting with the desktop at a time? That is an absolute requirement. The displayed position of the cursors are just empty drawings to the GPU. They actually have to use the local Computer mouse cursor for all the work - they just hid it by making it invisible and drawing it's image where it last used to be.

    3. You need to define "too slow". Is it taking up to much CPU resources? Is are the cursors moving too slow? You know that Windows modifies the raw input quite a bit before it moves the Windows Mousecursor?


    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.



    Monday, July 15, 2013 2:52 PM
  • Okay you have to totally ignore what Wyck and I said earlier about not being able to display more then one mouse cursor. Not only can you have more then one MouseCursor on the same Desktop, Micrsoft made an SDK for it:

    http://www.microsoft.com/multipoint/mouse-sdk/

    http://en.wikipedia.org/wiki/Windows_Multipoint_Mouse

    Sorry, we did not knew. It's so new, the Wikipedia Search still finds the Multipoint Server Operationg system instead.

    One downside for most use cases (not yours) is that it only works with mice directly conencted to the computer in question.
    The MultiMouse Software you had noted expands the MultiMouse SDK by also adding Remote Desktop features:

    "The disadvantage of Microsoft's MultiPoint solution, however, is that all users need to be sitting directly next to the shared computer. Alternatively, you need expensive custom hardware and mouse devices with extra-long USB cables and expensive industrial USB hubs with 20+ sockets to allow students in a classroom to connect to the central PC.

    MultiMouse instead allows meeting participants to use the mouse and keyboard of their own computer while be able to collaborate on the same desktop screen. The remote cursors are sent via a standard WLAN or Ethernet network."


    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.


    Monday, July 15, 2013 3:07 PM
  • Okay you have to totally ignore what Wyck and I said earlier.

    Ouch.  Please don't ignore what I said.  I stand by my answer.

    Monday, July 15, 2013 7:20 PM
  • Made a more specific starting sentence.

    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.

    Monday, July 15, 2013 7:41 PM
  • hey, i didn't ignore your answers, i read your answers and i said i need some help for my project!

    i read many articles before and in them people says that the windows only identifies one cursor, that's why i used RawInput to make extra cursors!

    christopher thank you for introducing this sdk, it's exactly what i want, i'm gonna use it to draw my cursors on desktop not only in my form and i hope it works.(and i realy happy, It Works RealTime!)

    but it's going be a problem to me if two mice clicks on desktop at the same time, i'm sure i can figure it out.

    i don't know yet how, but i know there is way. 

    i'm need to go now and try this sdk!

    thanks again

    Tuesday, July 16, 2013 5:57 AM
  • The SDK is only for Applicationts and the one example I could run without having Office 2007 installed used fullscreen. And I could not work with it, as it failed to detect my PS/2 Touchpad and did not work properly with my USB Trackball either.
    You need to write a Fullscreen App that takes in the "normal" Desktop Graphics output underneath it and draws the extra mouse cursor(s) over it. (Or you can draw directly over the Desktop?). It would propably collide (and go to background) whenever something else enters fullscreen.

    "At them same time" is relative. For users it is impossible to ever click at the same time, one will always come first. The event queue processes events one after the other no matter how close they were:

    Mouse A Clicks on Pixel XY
    Makes the real cursor invisible and repalces it with a dummy-graphic.
    Move the Mousecursor to Postion of A's Click.
    Click
    Return it to the starting point, disable the dummy graphic and make it visible again.

    Mouse B Clicks on Pixel AB
    Makes the real cursor invisible and repalces it with a dummy-graphic.
    Move the Mousecursor to Postion of B's Click.
    Click
    Return it to the starting point, disable the dummy graphic and make it visible again.

    Holding the Mouse Button (especially Dragging something) is the problematic part. The other mouse's Graphics could still move, but obviously they  can't interact with Desktop UI as long as the Drag applies.

    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.

    Tuesday, July 16, 2013 10:33 AM
  • To be entirely unhelpful, Google have provided this video/tool: 

    https://www.google.com/chrome/multitask.html


    Thursday, December 18, 2014 1:42 AM
  • there is this https://pluralinput.com/ haven't tried it yet tho but it sounds interesting
    Wednesday, November 29, 2017 1:03 AM
  • You can download an old version of teamplayer which is free for personal use.

    w w w. raymond .cc/blog /downl oad/di d/259 4/#wot

    Get rid of the spaces in the url.

    Tested, works on latest version Windows 10 64-bit. I know I'm late, but I'm trying to help everyone else out.

    Friday, May 10, 2019 4:37 PM