Hello,
Do you think there is way to manage two mouses with love2D (each player has one mouse to play with) ?
Connect two mouses
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Connect two mouses
Yes. According to the SDL wiki, mouse event enums contain the mouse device ID, only löve doesn't utilize it, so one could write their own wrapper functions that handled these via FFI, instead of the ones löve uses in love.mouse.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
- slime
- Solid Snayke
- Posts: 3160
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Connect two mouses
SDL doesn't support unique events for multiple mice in any of its backends, despite its external API being capable of outputting the information.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Connect two mouses
Well then, after being trolled by the SDL wiki, there's still a way, at least for windows;
WinAPI does support functions that do identify which mouse device sent any movement/button state change information (i used these previously when i was coding in delphi 6) so technically, on windows, one could still use those functions.
Downside is, you'd have to sidestep SDL's mouse event handling completely, and it won't be crossplatform. (unless, you know, all other OSes would have similar faculties you could use, and code those into your game as well)
In short, it's problematic to do.
WinAPI does support functions that do identify which mouse device sent any movement/button state change information (i used these previously when i was coding in delphi 6) so technically, on windows, one could still use those functions.
Downside is, you'd have to sidestep SDL's mouse event handling completely, and it won't be crossplatform. (unless, you know, all other OSes would have similar faculties you could use, and code those into your game as well)
In short, it's problematic to do.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Connect two mouses
Thanks guys, for these info. You confirm my analysis that there is no easy way to manage two mouses.
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests