Comment 0 for bug 427612

Revision history for this message
In , Bas Wijnen (shevek) wrote : libsdl1.2: Lock keys don't give release events

Package: libsdl1.2
Severity: normal
Tags: patch

SDL gives the caps-lock and num-lock keys a special treatment for
handling events: On key press, the state is changed and a pressed or
released event is generated accordingly, actual key release is
completely ignored. For applications which require text input, this is
fine, but if the lock keys are to be used as "just any key", for example
for controlling the movement of a player in a game, this is a problem.

The attached patch keeps the old behaviour by default, but does not give
the keys any special treatment (well, in fact, they don't repeat) if the
environment variable "SDL_DISABLE_LOCK_KEYS" is set at application
startup. The application can force this by setting it before calling
SDL functions.

Thanks,
Bas Wijnen

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)