Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Multiple mouse inputs?  (Read 4401 times)

0 Members and 1 Guest are viewing this topic.

ath88

  • Newbie
  • *
  • Posts: 12
    • View Profile
Multiple mouse inputs?
« 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Multiple mouse inputs?
« Reply #1 on: August 18, 2013, 10:51:23 pm »
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.
Laurent Gomila - SFML developer

ath88

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Multiple mouse inputs?
« Reply #2 on: August 18, 2013, 10:57:16 pm »
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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Multiple mouse inputs?
« Reply #3 on: August 18, 2013, 11:16:41 pm »
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.
Laurent Gomila - SFML developer

ath88

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Multiple mouse inputs?
« Reply #4 on: August 18, 2013, 11:25:53 pm »
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. :)

spacechase0

  • Newbie
  • *
  • Posts: 39
    • AOL Instant Messenger - thespacechase0
    • View Profile
    • http://spacechase0.com/
Re: Multiple mouse inputs?
« Reply #5 on: August 19, 2013, 12:56:54 am »
You might be able to use ManyMouse. It also has a zlib license. It seemed to work well when I tried it.

ath88

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Multiple mouse inputs?
« Reply #6 on: August 19, 2013, 02:34:37 pm »
ManyMouse looks perfect! I will post here when i know how it cooperates with SFML.

Regards

ath88

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Multiple mouse inputs?
« Reply #7 on: August 08, 2014, 02:20:14 am »
For future reference and people searching, this is indeed possible.

I've got a slightly long minimal example here: https://github.com/ath88/MMSFML

 

anything