while the only thing happening in an allegro program.
is keeping a key pressed for a prolonged period of.
time, it so happens that also release events occur.
between those press events of the same key. (tested
in X window system v7, ubuntu 6.06 ...)
allefant(Elias Pschernig) on #allegro suggested this
change(just giving credit where credit is due)
on ./src/x/xwin.c at line 2294 (on the 4.3 svn
revision 7443, current as of 03 August 2006):
(event->xkey.time <= next_event->xkey.time +1))
which I've tested it and it compiles to run ok(, but
who knows what other side effects this fix may have,
but so far it is a good workaround.)
Logged In: YES
user_id=1205967
ok, here's another patch (disregard the first which seemed
to be patchin a hack) the following is the context and the
change that needs to be made in file src/x/xkeyboard.c (too
lazy to make a patch:-"):
"
endif
private_get_keyboard_mapping ();
bool detectable_autorepeat_supported;//false if not supported
XkbSetDetectableAutoRepeat (_xwin.display,True,
&detectable_autorepeat_supported);
XUNLOCK ();
xkeyboard_installed = 1;
return 0;
}
" src/x/xkeyboard.c (around line 744) of revision 7454(svn)
and the hack that has to(also) be removed from src/x/xwin.c
around line 2286:
"
switch (event->type) {
case KeyPress:
_al_xwin_keyboard_handler(&event->xkey, false);
return 1;
case KeyRelease:
/ Hack: if a KeyRelease is sent at the same time as a
* KeyPress following it with the same keycode, we
assume
* that the intended effect was an autorepeat.
/
/ if ((next_event) &&
(next_event->type == KeyPress) &&
(event->xkey.keycode ==
next_event->xkey.keycode) &&
(event->xkey.time == next_event->xkey.time))
{
// Key repeat.
_al_xwin_keyboard_handler(&next_event->xkey,
false);
return 2;
}/
_al_xwin_keyboard_handler(&event->xkey, false);
return 1;
case FocusIn:
_switch_in();
" src/x/xwin.c (l:2286) of same svn revision.
inspired from
http://lists.freedesktop.org/archives/xorg/2006-June/015820.html
and
http://lists.freedesktop.org/archives/xorg/2006-June/015821.html
AND allefant(Elias)