Re: Keyboard Key Repeats



On Mon, 29 Aug 2011 06:52:44 -0400
Craig <craigbakalian verizon net> 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
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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]