Scope / lifetime rules for MouseInputSource?


#1

MouseEvent has a reference to a MouseInputSource. Is it okay to grab a pointer to that reference, and use it later? What are the lifetime rules for MouseInputSource (if any)?


#2

Yeah, they hang around for the whole runtime. Might even be static objects, depending on the OS.


#3

How do you actually get a consistent pointer to a MouseInputSource? I’m trying to use this to identify different touches, but I get a different address for mouseDown than for mouseDrag for example.