lkml.org 
[lkml]   [1999]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PATCH: sticky shift keys: bug fix and more intuitive behaviour

Werner Almesberger writes:

> There doesn't seem to be a maintainer for keyboard.c

Perhaps not. On the other hand, I wrote most of the code involved
and still feel a bit responsible.

> #ifdef CONFIG_SMART_SLOCK

I am not so happy with this conditional stuff.
If we can figure out which behaviour is most desirable then we make
the kernel do just that. If we cannot figure that out, then clearly
both behaviours have advantages, and we want to have an ioctl or so,
so that each user can select what she likes.

In this particular case, I wrote the `sticky modifier' stuff upon request
of two or three people that either could use only a single finger, or
used a mouth stick. In such a situation the question does not arise
what should happen if you press a sticky modifier simultaneous with
some ordinary key. So, probably, if you have a use for modifier keys
that sometimes are used as sticky keys and sometimes as ordinary keys
then it should be OK to treat them as sticky only when they are pressed
and then released without intervening key presses.

> static void boot_it(void)
> {
> + if (kbd->slockstate & ~shift_state) return;
> ctrl_alt_del();
> }

Hmm. Very ugly. And wrong besides, I think.
Wrong: a 1-finger typist comes and hits Ctrl, next Alt, next Del.
At this moment shift_state is zero and slockstate is Ctrl | Alt,
if I am not mistaken. So you do not want to allow her a reboot?
Unnecessary: ctrl_alt_del() does not necessarily reboot, but does
whatever /etc/inittab has under ca. You may ask for confirmation.
Or, you may bind the boot_it() function to a 4- or 5-key combination
that you are less likely to type by mistake. Or ...
So many ways to avoid a reboot by mistake other than by complicating
the keyboard driver.


> #if 1 /* how? two almost equivalent choices follow */
> compute_shiftstate();
> + kbd->slockstate = 0;
> #else

Yes. You are quite right. At least this line should be added to
2.0.37 / 2.2.* / 2.3.*.

[Alan: a contribution to drivers/char/keyboard.c for 2.0.37]


All the best - Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.033 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site