I would like to know whether there exist games running on one computer but collecting input from two players using each a mouse or joystick connected to the same computer?
If they exist, how does the game keeps separated the data from the two mice/joysticks?
Thanks in advance, Stefan
Well, this seems to be similar to what you want. Teamplayer3 allows multiple mouse pointers at the same time: http://www.dicolab.com/products/teamplayer/
That is on windows. On *nix, check this project: http://www.icculus.org/manymouse/
Related
Lets say we've got a Gaming MMO-mouse that has 12 keys at the side.
I researched a bit and found out that Windows doesnt really support so many keys so you'd have to use the mouse driver to access the keys. What I didnt find is, how do you access the keys with the driver?
All these mice have their respective software that lets you rebind them but whats interesting to me is how that looks like on a lower level without the software.
How do I poll for the pressed macro keys in my own c++ program?
How do we exchange information with the driver?
Suggest, write a small program that polls the USB port where the mouse is connected,
each time it receives data from the mouse, display that data.
Keep track of the correlation between which mouse action you made and the resulting input from the mouse.
I am running Arch Linux on a Raspberry and need to get the positioning data for 4 USB mice from a C++ application, as in for each individual mouse I need to know how many pixels it has moved whenever it moved. I do not have x server on my system and would prefer to leave it that way unless necessary because this is for an embedded project that does not require a GUI and I would prefer not waste space or overhead on x server.
The most useful thing I have found is this link https://www.kernel.org/doc/Documentation/input/input.txt but I cannot really figure out how to make it work for my purpose. As can obviously be determined I am NOT experienced in Linux development do don't be to hard on me please.
You open e.g. /dev/input/mouse0 for reading (using open), then read the structure defined in the document you linked (at the bottom of the document), it also says which header file to include.
I'm guessing you will get an event of type EV_REL for mouse-movement, with a code of REL_X or REL_Y for the direction of the movement, and the value is the number of units the mouse moved. Compare the timestamp to the timestamp of the previous event to see how fast it moves.
There is osgGA::GUIEventAdapter in OpenSceneGraph that could detect mouse events. However, I want the program to detect two mice on the same computer and the program can only treat two mice as one. I know there is a Windows MultiPoint Mouse SDK, but I think it is used in WPF with C#, not sure if it could be used in C++
Also, there is a GlovePie, but it is not open source and not sure how to use that in vs2010.
VRPN may be a good choice, but do not know exactly how to implement two mice. Get the dll files of two mice and extract functions by vrpn?
Take a look at "Raw Input" (http://msdn.microsoft.com/en-us/library/windows/desktop/ms645543(v=vs.85).aspx)
From that page:
An application can distinguish the source of the input even if it is from the same type of device. For example, two mouse devices.
I'm currently building a c++ program (with Qt) to take picture from a camera device. This part is actualy done, now I need to control 8 flashs divided in two groups in an automatic way.
The flash I already use are from ELINCHROM http://www.elinchrom.com/ and this device seems to be perfect for what I need but I could not find anywhere a way to control it from a different application than the one elinchrom propose.
Do you know if what I intend to do is even possible? If a solution exist with another brand I will also take it.
Thank you in advance for any replies, and please excuse my english.
Should be possible; the driver guide states that the driver is really a USB serial port driver. That means you can probably reverse-engineer the protocol.
Basically I'm currently using the wiiuse library to get the wiimote working on linux. I want to now be able to control the mouse through the IR readings.
Can somebody point me in the right direction as to how to approach this? I know of uinput but there doesn't seem to be a lot of tutorials/guides on the web.
I'm working with c/c++ so a library in c/c++ would be helpful.
Cheers.
I think you should look into "becoming" a new mouse device. This would require developing a device driver that knows how to read the Wii device, and present that data to the input system as if it came from a mouse. The Linux kernel supports multiple mice connected at the same time, and merges the inputs from all of them, so this will work fine.
This book might be a handy help along the way. Not sure if it's possible to do this totally in userland, but that is of course worth investigating too.
I`m not sure if I understood you question corectly. If looking for controling mouse pointer from userspace look at XTest Extension Usefull link
Edit:
From kernel POV uinput looks like good starting point
In the end I decided to just draw "cursor" objects on the screen and use setup each input device to control a separate "cursor" object. This seemed the best idea as we were short on time.