THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/10/2012 at 08:36, xxxxxxxx wrote:
Just stumbled upon this: can you determine if the mouse button is pressed but not releasedand execute something while it is pressed?
I'm working on a tool-plugin and can fake it by using mousedrag, but then in fact you have to drag the mouse at least one pixel. I want to give some visual feedback while the button is pressed but the mouse not dragged.
Is this possible?
On 22/10/2012 at 06:56, xxxxxxxx wrote:
Here's how you can determine if a mouse button is pressed, mouse left is tested in this example:
def MouseInput(self, doc, data, bd, win, msg) :
print "Begin Mouse Left Pressed"
bc = c4d.BaseContainer()
if gui.GetInputState(c4d.BFM_INPUT_MOUSE, c4d.BFM_INPUT_MOUSELEFT, bc) :
print "Mouse Left Pressed"
if not bc.GetBool(c4d.BFM_INPUT_VALUE) : break
print "End Mouse Left Pressed"
c4d.BFM_INPUT_VALUE tells if a channel is active or not; if it's false the loop is ended.
On 22/10/2012 at 07:34, xxxxxxxx wrote:
Thank you very much,
works exactly how I wanted. I'll try to wrap my head around it