[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Pointer module
Some feedback
The code is nice and understandable, here are a few suggestions:
Might be nice to use properties to access set_pos, get_pos then
callers could just use .pos
If a name isn't specified for the pointer, perhaps one could be generated?
It may be worth differentiating between global position and relative
position pointers
(although some things can be either, maybe these could have a mode switch)
Pointer groups
Pointer groups could be useful + a global pointer (group of all available).
The global pointer might be useful for front ends.
Pointer groups could be useful for a sort of poor-mans multitouch
(with multiple mice), or
could be useful for team games (assuming you can get the individual
positions too).
A function where you can request a kind of pointer with possible
fallbacks might be good
get_pointer('wiimote', 'mouse', 'joystick')
2009/1/22 Stuart Axon <stu.axon+pygame@xxxxxxxxx>:
> Are we still waiting on SDL for support for multiple mice?
>
> OT:
> I want to try multiple pointing device on windows with python (just
> test with 2 mice and a tablet), any idea if this is feasable ?
>
>
> 2009/1/11 Thiago Chaves <shundread@xxxxxxxxx>:
>> Hi,
>>
>> I decided to improve the UI on my recent project and decided to allow
>> users to use joysticks as pointing devices too. To do that I defined a
>> class that encapsulates both mouse and joystick and gives them an
>> interface (slightly) similar to the mouse module. I figure the pointer
>> classes could still be improved, but I decided to release one early
>> version of it along with an example to get some early feedback on the
>> idea.
>>
>> There's really no advantage on using this over mouse module if you're
>> using only mouse. It'd make sense in situations where you got both
>> joysticks and mouse as pointing devices. (local multiplayer
>> point-and-click games, anyone?)
>>
>> There's an example, which just uses the mouse and as many joysticks as
>> you have as pointing devices. Notice the joystick devices start
>> pointing at (0, 0)
>>
>> Could anyone give this a try and give me some feedback? What is good?
>> What is bad? What is missing? What is unnecessary?
>>
>> Thanks,
>>
>> -Thiago
>>
>