You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<marcel> Heyho, can anybody tell me how to prevent a widget from consuming a specific key event? I have a TreeView and it consumes the events of the keys "Left" and "Right".
<albfan[m]> marcel: you need to override keyevent managing and return false on those keys
<marcel> How'd I do that? I was looking the documentation for Gtk.Widget and couldn't find anything like thta.
<al> marcel: i think https://valadoc.org/gtk+-3.0/Gtk.Widget.event.html is worth a try
<marcel> I see, thanks, I shall take a look at that.
<al> and https://valadoc.org/gtk+-3.0/Gtk.Widget.key_press_event.html
<marcel> Well that's the event, I can't override anything in the event itself, right?
<marcel> I thought a signal doesn't have any logic, it's basically just a connector
<al> in you class you want something like: public override signal bool key_press_event (EventKey event) { return false; }
<al> if that works for all keys then write some more code just to file left and right
<al> *filter
<al> oh and drop the signal, public override bool key_press_event (EventKey event) { return false; }
<al> i'm probably getting confused, you want key_press_event.connect, but have a look at https://wiki.gnome.org/Projects/Vala/SignalsAndCallbacks
The text was updated successfully, but these errors were encountered:
Taken from GIMPNet IRC:
The text was updated successfully, but these errors were encountered: