[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Detect key modifier status in 'sleep --interruptible'

From: Colin Watson
Subject: Re: [PATCH] Detect key modifier status in 'sleep --interruptible'
Date: Wed, 12 Aug 2009 23:14:31 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Wed, Aug 12, 2009 at 06:10:18PM +0200, Vladimir 'phcoder' Serbinenko wrote:
> Colin Watson wrote:
> > This is based on previous work in GRUB Legacy by Kristian and Peter
> > (CCed). Peter tells me that Red Hat has an assignment already on file,
> > and it looks like mine is finally making some progress ...
> We would need RedHat and Kristian to sign some papers.

Peter said they were already done, but if that's the case then fine.
Peter/Kristian, can you double-check this?

> Constants are i386-pc specific. In particular left and right shift are
> distinguished but not ctrl or alt. We should either distinguish them
> all or none.

The values I picked for the constants were convenient for i386-pc, but
that's because it's the only architecture that currently needs an
assembly implementation and it seemed to make sense to me to put the
harder work of transforming values around into C code.

I'm not sure what you mean by "distinguish" here though. I included
constants for control and alt that are currently unused, which may
actually have been a mistake since the original Red Hat patch to GRUB 1
honoured those too in its hiddenmenu handling. Is that what you mean?

> Going to real mode to retrieve keyboard status is absolutely
> unnecessary: same info is available in BDA. Perhaps our console driver
> should switch to BDA altogether but I'm not sure that this will work
> since grub2 disables interrupts (tests needed) but it definitly works
> with keyboard status.

OK, fair enough. The attached updated patch makes this change.

> Driver should return a consistent value even if it doesn't support
> asynchronous query unless driver ignores modifier keys altogether
> (EFI, sigh) or has no way to know if they are pressed unless they are
> pressed together with another key.

I honestly don't see much value in this. Think about what it's being
used for; users are not going to know or guess that Shift only works to
interrupt the boot if you press some non-modifier key too. On the basis
of not including code we aren't going to need, I think it's better to
not attempt to support independent queries of modifier key status on
such drivers at all, and just pretend that no modifiers are pressed.


Colin Watson                                       address@hidden

Attachment: keystatus.diff
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]