Hi Jannis,

Yes, yes.  I should have thought of this.  I am just going to put a
Key_Down variable in scope of the key-pressed-event function and the
key-released-event function, and set it accordingly.  God, I am getting
old.  

Yet, you have got my interest with the XKeyboardControl control thing.
I never knew it existed.  Thanks.

Craig Bakalian



On Tue, 2011-08-30 at 12:00 +0000, gtk-app-devel-list-requ...@gnome.org
wrote:
> > Hi All,
> > 
> > Don't we have a way to program (via gtk) if a key, when pressed,
> > repeats its signal?  Example- the 'a' key, if repeat is on key, I
> get> Hi All,
> 
> Don't we have a way to program (via gtk) if a key, when pressed,
> repeats its signal?  Example- the 'a' key, if repeat is on key, I get
> aaaaaaaaaaa, or if repeat is off I get one a.  Right now I am using
> the System Settings.

Connect to the key-press-event signal, remember the last key and ignore
follow-up press events for that particular key? (This requires to reset
the remembered key whenever a different key is pressed.)

If you want this behavior globally and not just in your application or
widget, you can do something like

  XKeyboardControl control;
  control.auto_repeat_mode = 0;

  gdk_error_trap_push ();
  XChangeKeyboardControl (GDK_DISPLAY (), KBAutoRepeatMode, &control);
  gdk_error_trap_pop ();

That will suppress repeated key press events entirely.

HTH,
Jannise
> > aaaaaaaaaaa, or if repeat is off I get one a.  Right now I am using
> > the System Settings.
> 
> Connect to the key-press-event signal, remember the last key and
> ignore
> follow-up press events for that particular key? (This requires to
> reset
> the remembered key whenever a different key is pressed.)
> 
> If you want this behavior globally and not just in your application or
> widget, you can do something like
> 
>   XKeyboardControl control;
>   control.auto_repeat_mode = 0;
> 
>   gdk_error_trap_push ();
>   XChangeKeyboardControl (GDK_DISPLAY (), KBAutoRepeatMode, &control);
>   gdk_error_trap_pop ();
> 
> That will suppress repeated key press events entirely.
> 
> HTH,
> Jannis 

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to