Re: GTK3 -- query mouse pointer coordinates for keyboard input?
- From: Stefan Salewski <mail ssalewski de>
- To: "Jasper St. Pierre" <jstpierre mecheye net>
- Cc: "gtk-list gnome org" <gtk-list gnome org>
- Subject: Re: GTK3 -- query mouse pointer coordinates for keyboard input?
- Date: Fri, 17 Jan 2014 23:05:00 +0100
On Fri, 2014-01-17 at 16:38 -0500, Jasper St. Pierre wrote:
If you have a keyboard device, you can use
gdk_device_get_associated_device() to return the paired mouse device.
Fine -- but currently I have only a keyboard event as described in
https://developer.gnome.org/gdk3/stable/gdk3-Event-Structures.html#GdkEventKey
There is no reference to a device. For mouse buttons I have
https://developer.gnome.org/gdk3/stable/gdk3-Event-Structures.html#GdkEventButton
which has a device field. That is fine.
After much googling I found GdkDisplay
https://developer.gnome.org/gdk/unstable/GdkDisplay.html
which may help finding a pointing device, but that seems to be much
complicated overhead.
You may say that mouse and keyboard input is generally fully unrelated.
In theory that may be true, but for CAD applications we really want
keyboard input related to current mouse pointer position, i.e. delete
object under mouse cursor when 'X' or 'DEL' key is pressed. That is much
faster than context menu or button clicks. And professionals prefer
working fast.
Best regards,
Stefan Salewski
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]