SFML community forums
Help => General => Topic started by: ath88 on August 18, 2013, 10:41:29 pm
-
Hello there,
I am interesting in receiving several mouse pointer inputs for a project i am working on. Will there be any way to make this work in SFML? I tried searching, but came up empty-handed.
Regards, ath88
-
This is not supported in SFML.
Can you tell me more about your use case? I can't think of any useful case where multiple mice would be used, except in academic projects.
-
It is a simple arcade-type game with multiple players at the same screen. The player entity is moved with the mouse, so multiple players will require multiple mice. Imagine a split-screen game.
I would imagine that it might be possible to get some kind of device-identification passed along with a move-event. Perhaps some USB device library could help me.
-
What SFML gives you is the pointer events; can you even have multiple mouse pointers in any desktop OS? To be honest I don't know much about how OSes and their libraries handle multiple mice, but you may have to handle things at a lower level.
-
I guess SFML gives me the pointer events from the OS device driver, which normally only supports a single pointer. As with laptops with a connected mouse, both touch pad and mouse controls the same pointer. But since mice are 'just' USB devices, it should be possible to get the events directly from there via some USB device library.
I see that SFML can not help me here. Thank you for your help. :)
-
You might be able to use ManyMouse (https://icculus.org/manymouse/). It also has a zlib license. It seemed to work well when I tried it.
-
ManyMouse looks perfect! I will post here when i know how it cooperates with SFML.
Regards
-
For future reference and people searching, this is indeed possible.
I've got a slightly long minimal example here: https://github.com/ath88/MMSFML