Gtk, get coordinates of keypress


#1

Hi, I’m trying to get a keypress to do something based on the mouse coordinate in a GtkCanvas widget. I can receive the keypress in the main GtkWindow, and I’d like to translate the coordinates with the library call gtk_widget_translate_coordinates( ), but it doesn’t look like this is exposed in the Gtk package. Is there another way to do this?

Edit: I didn’t realize that the keypress event doesn’t even have mouse coordinates associated with it, so I am on the wrong track… I want to get the coordinates of the mouse in the GtkCanvas when I press a certain key.

Julia version 0.6.1
Gtk version 0.13.1
Thanks you,
Kurt


#2

I decided to use the mouse motion signal continuously to keep track of the last mouse coordinates, and then use those when a key is pressed…