Bonus function to get modifier key states for anyone confused by bitmasks
in Python:

def getModifierStates():
    bits = Application.GetKeyboardState()('Shift')
    return { 'shift': bool( bits & 1 ),
             'ctrl':  bool( bits & 2 ),
             'alt':   bool( bits & 4 ) }
print getModifierStates()


You can take my pickForever() function and in the "while 1:" part, change
it for "while getModifierStates()['shift']:".

;)



On Tue, Nov 12, 2013 at 10:33 AM, Eric Thivierge <ethivie...@hybride.com>wrote:

> http://darkvertex.com/wp/2012/07/05/xsi-picking-forever-in-python/
>
>
> On Tuesday, November 12, 2013 10:31:52 AM, Ognjen Vukovic wrote:
>
>> Hi guys,
>> me again :)
>>
>> One quick question, how would one go about editing the pick element
>> command in python so that it takes in multiple selections whilst the
>> shift modifier is down?
>>
>> destMDLPicked = si.PickElement(c.siModelFilter, 'Pick Destination
>> Model', 'Pick Destination Model')
>> destMDLObject = destMDLPicked[2]
>>
>> Thanks in advance,
>> Ogi.
>>
>
>

Reply via email to