[Gtk-sharp-list] block escape key

Ганьков Андрей gankov.andrey at inbox.ru
Wed Feb 21 14:47:47 UTC 2018


if (args.Event.Key == Gdk.Key.Escape) {

try set args.RetVal = true or may be false
I think it can stop cascad handle of event. By analogy with other 
events, setting an excellent value for RetVal, say gtk that the click is 
processed and other handlers do not need to be called.

On 21.02.2018 16:20, Renato Salvador wrote:
> Good Morning. I have the following problem: I have a program in gtk # 
> with a main form that when pressing a key the same opens a dialog form 
> where in this form I have to block the escape key. because today when 
> pressing this key it is recognized in the main form and should not do 
> anything in it. Good thing that when pressing it does not execute 
> anything in the form dialog that is open or in the main form. any 
> suggestion?  I created this event in the form but even so by pressing 
> the key the main form also recognizes that it has been pressed and 
> executes the rest of the code after the run () of the form dialog. 
> [GLib.ConnectBefore] protected void KeyPress (object sender, 
> KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.BackSpace) { 
> if (classModulePrincipal.configuration.EnabledDisplayKeyboard) { if 
> (txtValue.Text.Length> = 1) 
> classModuloPrincipal.gblobjTeclado.backSpace (); } } if 
> (args.Event.Key == Gdk.Key.Escape) { txtFormaPagamento.Text = 
> string.Empty; txtValue.Text = string.Empty; txtFormaPagamento.IsFocus 
> = true; // return; } }

Andrey Gankov
Mail:gankov.andrey at inbox.ru
ICQ: 230-684-976
Jabber:gankov at jabber.ru

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/gtk-sharp-list/attachments/20180221/14610d11/attachment.html>

More information about the Gtk-sharp-list mailing list