On 17/06/2013 at 05:17, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Robert - I did initially have a SH plugin and was testing for op->GetType()==MyPluginID, but I don't particularly like the idea of the SH sitting in the background all the time. Though I may have to suffice with it.
LD - do you mean testing if(GetInputState(blah)) inside the Draw() function?
WP.
GetState() does only return if polling the asked channel has been successful, so directly
testing it does not make much sense, as the result does not reflect the result of the testing.
Simply poll the current mouse state in the method of your choice and then proceed as you
wish. A little python script example(there is no difference for the general approach for cpp) :
import c4d
from c4d import gui
#Welcome to the world of Python
def main() :
bc = c4d.BaseContainer()
if gui.GetInputState(c4d.BFM_INPUT_MOUSE, c4d.BFM_INPUT_MOUSELEFT, bc) :
gui.MessageDialog('Cursor is at x:{0}, y:{1}'.format(bc[c4d.BFM_INPUT_X],
bc[c4d.BFM_INPUT_Y]))
if __name__=='__main__':
main()
Maybe I did not understand correctly what you want to do.
Happy rendering,
Ferdinand