View previous topic :: View next topic |
Author |
Message |
Dubhead
Joined: 08 Sep 2008 Posts: 4 Location: Tokyo, Japan
|
Posted: Mon Sep 08, 2008 3:22 am Post subject: return value of KeyRelease callback is ignored? |
|
|
Thanks for RC2!
In Gtk+, when the callback for KeyRelease event returns TRUE, the event isn't propagated further,
as explained in http://library.gnome.org/devel/gtk/stable/GtkWidget.html#GtkWidget-key-release-event
In GtkD RC2, the return value is not checked, and the event is always propagated.
Here is a simple patch:
Code: |
--- Widget.d.orig 2008-09-08 18:14:25.000000000 +0900
+++ Widget.d 2008-09-08 18:14:49.000000000 +0900
@@ -1752,7 +1752,9 @@
foreach ( gboolean delegate(GdkEventKey*, Widget) dlg ; widget.onKeyReleaseListeners )
{
- dlg(event, widget);
+ if (dlg(event, widget)) {
+ return true; // event consumed
+ }
}
return consumed;
|
A similar patch should be necessary for KeyPress. |
|
Back to top |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Mon Sep 08, 2008 12:55 pm Post subject: |
|
|
added in svn r606, along with all the other events that can return a bool. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|