How do you get mouse movement info in GtkD?

Enjoys Math via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jan 29 22:43:11 PST 2016


On Saturday, 30 January 2016 at 06:33:55 UTC, Enjoys Math wrote:
> I'm able to get the mouse click positions with 
> event.button().x/y
>
> But what .x/y do you query inside of an onMotionNotify event 
> handler?
>
> Thanks!

I see now:
	bool onMouseMove(GdkEventMotion* eventMotion, Widget widget) {
		//event.get
		writeln("Mouse move event in scene.");
		return true;
	}

addOnMotionNotify(&onMouseMove)

There's also one that takes an Event param, but there's no 
obvious way to get the x/y info from that so I'll just use this 
lower level one which seems to work.


More information about the Digitalmars-d-learn mailing list