[Bf-python] Logical Window.GetMouseButtons()
Stephen Swaney
sswaney at centurytel.net
Thu May 3 16:45:35 CEST 2007
On Thu, May 03, 2007 at 10:18:44AM +0200, Michael Schardt wrote:
> @ Joe: You're right - i was not sure if this is the best solution.
>
> Not that i'd consider an additional option bad form in general - there are several examples in the current API - but the MButs constants are of course confusing in this context.
> The alternative would be a separate function Window.GetLogicalMouseButtons() and new constants to compare against.
> Something like Window.LMButs.S, LMButs.M, LMButs.??? for L(ogical)M(ouse)But(ton)s.Select, Middle, ???.
> That's what i tried to avoid - not to introduce a new function and new constants for everything but having fewer and more "powerful" functions.
> Or is all this nonsense and there's already a possibility of telling the logical button state or the usersettings "Select with ..." which i don't know?
> I'm open for any suggestions.
I haven't thought about this long enough to decide between extending
the existing func or adding a new one. We *are* reworking the API
with the new bpy module, which gives us the opportunity to rethink what
we are doing.
However,
a) I hate methods with obscure numeric args like GetMouseButtons(0). Better
to use a keyword argument, IMHO. Code should be readable.
b) since this is a boolean, we need to use PyObject_IsTrue() to
process the argument.
--
Stephen Swaney
sswaney at centurytel.net
More information about the Bf-python
mailing list