Bug#399945: libsdl1.2debian: NumLock modifier broken.
Bart Oldeman
bartoldeman at users.sourceforge.net
Wed Nov 22 23:42:20 UTC 2006
Package: libsdl1.2debian
Version: 1.2.11-7
Severity: normal
Bug #317010 contains a patch to optionally change the handling of numlock
and capslock. However, it was applied in reverse; the default behaviour
has changed, and you only get the standard (stock SDL) behaviour if you set
SDL_DISABLE_LOCK_KEYS.
I suggest changing
++static char *SDL_UseLockKeys;
...
++ SDL_UseLockKeys = getenv("SDL_DISABLE_LOCK_KEYS");
...
++ use_lock_keys = ( SDL_UseLockKeys && *SDL_UseLockKeys );
to
++static char *SDL_DisableLockKeys;
...
++ SDL_DisableLockKeys = getenv("SDL_DISABLE_LOCK_KEYS");
...
++ use_lock_keys = !( SDL_DisableLockKeys && *SDL_DisableLockKeys );
below is a simple test case: just press numlock a few times and look at
the terminal output.
/* compile with gcc -I/usr/include/SDL -lsdl test.c */
#include <stdio.h>
#include <unistd.h>
#include <SDL.h>
int main(void)
{
SDL_Event event;
SDL_Init(SDL_INIT_VIDEO);
SDL_SetVideoMode(640, 480, 16, 0);
for(;;) {
while(SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_KEYDOWN:
case SDL_KEYUP:
printf("sdl:numlock is %s\n",
event.key.keysym.mod & KMOD_NUM ?
"on" : "off");
break;
case SDL_QUIT:
exit(0);
}
}
usleep(100000);
}
SDL_Quit();
return 0;
}
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-exec-shield-1
Locale: LANG=en_NZ, LC_CTYPE=en_NZ (charmap=ISO-8859-1)
Versions of packages libsdl1.2debian depends on:
ii libsdl1.2debian-alsa 1.2.11-7 Simple DirectMedia Layer (with X11
libsdl1.2debian recommends no packages.
-- no debconf information
More information about the Pkg-sdl-maintainers
mailing list