All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: Jamie Lokier <jamie@shareable.org>
Cc: Vojtech Pavlik <vojtech@suse.cz>,
	Andries Brouwer <aebr@win.tue.nl>,
	Neil Brown <neilb@cse.unsw.edu.au>,
	linux-kernel@vger.kernel.org
Subject: Re: Input issues - key down with no key up
Date: Fri, 15 Aug 2003 15:52:14 +0200	[thread overview]
Message-ID: <20030815135214.GB15872@ucw.cz> (raw)
In-Reply-To: <20030815132706.GG15911@mail.jlokier.co.uk>

On Fri, Aug 15, 2003 at 02:27:06PM +0100, Jamie Lokier wrote:

> I think you just have to accept that there are two designs in common
> use, and neither maps in a predictable way on to the other: keyboards
> which send the state (USB), and keyboards which never reveal the state
> (PS/2 with strange mixtures of DOWN+UP, DOWN only, repeating and
> non-repeating keys).

Well, all keyboards but PS/2 are able to report (or keep track) of the
state quite well, and regarding PS/2 only buggy keyboards that deviate
from the basic rules of sanity are a problem.

> Anything else is going to do the wrong thing with the other kind of
> keyboard, until the user does something special, which will be beyond
> many users to configure themselves.

Maybe.

> > > But that would require users to report on precisely which keys are affected
> > > and would give complications where I suppose 2.4 did not have any.
> > > This is the way towards an ever more complicated keyboard driver.
> > > Not what you would want.
> > 
> > I definitely want one single driver being more complicated than the core
> > getting more complicated.
> 
> The point is moot if the set of special keys on PS/2 keyboards is the
> same for all keyboards, though.

It is not. There is only ONE key that is not repeated on normal PS/2
keyboards and that is the Pause key. All other keys (including shift,
etc) are repeated. The Pause key, though, sends both Down and Up events
on the keypress, so it doesn't confuse the software.

> Then nothing special is required of
> the user.  That would be the best, if it is possible.

The best is never possible.

> But if not
> ----------
> 
> How about the PS/2 driver auto-discovers special (no UP event) keys:
> 
>   1. The range of known reliable keys, such as letters, can use software
>      mode (repeat, depends on UP reports) from the beginning.

Ok.

>   2. Set up _every_ other key to be non-repeating in software, with
> 
>      (a) consecutive DOWN events causing a synthetic UP just before
>          the second and subsequent DOWNs.

Won't work on keyboards which send more than one DOWN before an UP.
There are a bunch of these, notably the broken notebook keyboards.

>      (b) a synthetic UP after a timeout in the DOWN state.

That's what I'm planning to implement, with the timeout being the
hardware autorepeat delay. This way the sw autorepeat never kicks in
unless the hardware one does, too. On the PS/2 keyboards only.

>   3. Whenever the keyboard sends an UP, change that key (only that key) to
>      be in software mode like 1.
> 
> After booting, if the user presses "r", it will behave as expected -
> it's covered by 1.
> 
> If the user presses "Fn+F1" or some other unknown key which doesn't
> report UP events, it won't repeat and it will report DOWN then UP
> input events, once each time it is pressed.

Fn+F1 won't most likely generate a keypress event. It'll just change the
contrast via the BIOS or something.

I really believe that keys which generate the same scancode when pressed
and released (as per the report which started the thread) usually happen
because the keyboard is in some non-native mode.

I have keyboards which report the same scancode for both press and
release of several keys (making the keys undistinguishable) unless
switched to scancode set 3.

> If the user presses another unknown key such as "PrevTrack" which does
> report UP events, that will not repeat the first time it is pressed
> and released, but subsequently it will.
> 
> In all cases, the driver errs on the side of not creating more press
> events than it knows is safe.
> 
> -- Jamie

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

  reply	other threads:[~2003-08-15 16:16 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-15  5:16 Input issues - key down with no key up Neil Brown
2003-08-15  7:46 ` Andries Brouwer
2003-08-15 10:58   ` Vojtech Pavlik
2003-08-15 12:36     ` Andries Brouwer
2003-08-15 12:43       ` Vojtech Pavlik
2003-08-15 13:27         ` Jamie Lokier
2003-08-15 13:52           ` Vojtech Pavlik [this message]
2003-08-15 14:02             ` Jamie Lokier
2003-08-15 15:05         ` Jason Lunz
2003-08-15 13:04       ` Jamie Lokier
2003-08-15 13:10         ` Vojtech Pavlik
2003-08-15 13:33           ` Jamie Lokier
2003-08-15 13:53             ` Vojtech Pavlik
2003-08-16 13:02               ` Maciej W. Rozycki
2003-08-16 14:09                 ` Jamie Lokier
2003-08-17 21:54                   ` Vojtech Pavlik
2003-08-18 12:22                     ` Maciej W. Rozycki
2003-08-18 10:29                 ` Andries Brouwer
2003-08-19 13:04                   ` Maciej W. Rozycki
2003-08-19 17:48                     ` Andries Brouwer
2003-08-21 11:37                       ` Maciej W. Rozycki
2003-08-21 12:44                         ` Andries Brouwer
2003-08-21 13:45                           ` Maciej W. Rozycki
2003-08-21 14:28                             ` Andries Brouwer
2003-08-21 14:38                               ` Maciej W. Rozycki
2003-08-21 13:48                         ` Jamie Lokier
2003-08-21 14:08                           ` Maciej W. Rozycki
2003-08-21 14:14                             ` Vojtech Pavlik
2003-08-21 14:33                               ` Maciej W. Rozycki
2003-08-21 14:44                                 ` Andries Brouwer
2003-08-21 15:03                                   ` Maciej W. Rozycki
2003-08-21 15:29                                     ` Vojtech Pavlik
2003-08-16 13:01             ` Maciej W. Rozycki
2003-08-15 12:46     ` Neil Brown
2003-08-15 12:54       ` Vojtech Pavlik
2003-08-15 13:52       ` Andries Brouwer
2003-08-15 14:13         ` Vojtech Pavlik
2003-08-16  7:57           ` Neil Brown
2003-08-18 16:01             ` Vojtech Pavlik
2003-08-19 11:40               ` Neil Brown
2003-08-19 11:50                 ` Vojtech Pavlik
2003-08-19 23:59                   ` Neil Brown
2003-08-20 22:36             ` Andries Brouwer
2003-08-20 22:58               ` Jamie Lokier
2003-08-20 23:52                 ` Andries Brouwer
2003-08-21  0:03                   ` Jamie Lokier
2003-08-21  0:33                     ` Andries Brouwer
2003-08-21  1:36                       ` Jamie Lokier
2003-08-21  8:08                       ` Vojtech Pavlik
2003-08-21  8:06                     ` Vojtech Pavlik
2003-08-21 11:40                     ` Maciej W. Rozycki
2003-08-21 12:48                       ` Andries Brouwer
2003-08-21 13:22                         ` Jamie Lokier
2003-08-21 13:29                         ` Maciej W. Rozycki
2003-08-21  8:01                   ` Vojtech Pavlik
2003-08-22  0:27                     ` Andries Brouwer
2003-08-22  7:33                       ` Vojtech Pavlik
2003-08-25  4:22                         ` Jamie Lokier
2003-08-25  8:22                           ` Vojtech Pavlik
2003-08-25 19:36                             ` Jamie Lokier
2003-09-03  8:06                               ` Pavel Machek
2003-08-22 13:35                       ` Maciej W. Rozycki
  -- strict thread matches above, loose matches on Subject: below --
2003-08-16 15:15 John Bradford
2003-08-18 11:53 ` Maciej W. Rozycki
2003-08-19 19:37 John Bradford
2003-08-19 23:58 ` Jamie Lokier
2003-08-20  5:59 John Bradford
2003-08-20 15:17 ` Jamie Lokier
2003-08-21 12:11 John Bradford
2003-08-21 12:26 ` Vojtech Pavlik
2003-08-23 12:30 Norman Diamond
2003-08-25  4:24 ` Jamie Lokier
2003-08-25 12:15   ` Norman Diamond
2003-08-25  8:45 John Bradford
2003-08-25 12:47 John Bradford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030815135214.GB15872@ucw.cz \
    --to=vojtech@suse.cz \
    --cc=aebr@win.tue.nl \
    --cc=jamie@shareable.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.