grub-devel
[Top][All Lists]
Advanced

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

Re: grub2 accessibility: beeps


From: Marco Gerards
Subject: Re: grub2 accessibility: beeps
Date: Thu, 30 Nov 2006 20:50:47 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Hollis Blanchard <address@hidden> writes:

> One topic that I've heard a lot about in the past few weeks is
> accessibility in grub2. Blind users, who otherwise have various devices
> like screen readers and brail TTYs, need to be able to interact with the
> bootloader.

Agreed.

> This can be as simple as using the PC speaker to beep when GRUB starts,
> and also to beep differently (e.g. different pitch, or different number
> of beeps) when highlighting different menu entries.

Right.

> Thanks to Vincent, we already have a PC speaker driver (cool!). However,
> we lack the ability to trigger it when switching menu entries (without
> selecting one). The problem boils down to this:
>         menuentry "foo" {
>               linux foo
>         }
>
> The commands inside the menuentry block are only executed when the entry
> is selected, not highlighted. Perhaps the menuentry command could be
> extended to take an optional beep argument:
>         menuentry "foo" <pitch> <duration> {
>               linux foo
>         }

I don't like this.  One reason is that this is hard to implement.  The
other is it is very specific and I am afraid "menuentry" becomes very
bloated.

> But wouldn't it be better to have something more general? Something like
>         menuentry {
>               title "foo"
>               beep pitch duration
>         }
>         {
>               linux foo
>         }

Perhaps, I was thinking about something like:

menuentry "foo" --beep=pitch,duration

In that case it looks like a command.

Actually, what I would prefer is something hooks.  It would be nice if
the C code in GRUB and perhaps also scripts can be hooked anywhere.
We have to be very careful about this, so perhaps limit the sets of
commands that can be used this way.  But I think it will make GRUB
more flexible while it is not too much effort.

I am thinking of the following functions:

One to install a hook:
grub_err_t grub_hook_register (const char *name, (*hook) (...));

To trigger the hook (for example, when the user types something,
selects another menu entry, etc.
void grub_hook_call (const char *name, ...);

How to pass arguments to functions and to scripts is something that we
have to think about.  For example, scripting functions have to get
strings, while in other cases we just want to deal with regular
function calls.  Perhaps a printf-like mechanism can help us with
this.

In that case your problem can be solved by using:

function handlemenu {
  beep depending on menuentry selected, the index is passed to this function
}

hook --install --hook=select-menu-entry --function=handlemenu

...

--
Marco





reply via email to

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