Custom keyboard shortcuts

Ray Strode halfline at gmail.com
Tue Sep 13 20:35:12 PDT 2011


Hey,

On Tue, Sep 13, 2011 at 10:23 AM, Marc Tarin <mt at tcpartners.fr> wrote:
> Hi everyone !
>
> I'm currently customizing a Linux From Scratch distribution, using plymouth as a bootsplash.
>
> I wanted to change the keyboard shortcuts so as to cater to my whims, so I gave a (quick) look at the source code.
>
> Correct me if I'm wrong :
> - shortcuts are defined in src/libply-splash-core/ply-boot-splash.c and src/libply-splash-core/ply-keyboard.c
There's some debugging stuff there. backspace, enter, and ctrl-c and
ctrl-d are handled in main.c (see set_keyboard() and the callbacks it
registers)

> - verbosity, text mode, etc, respond to a "single" keyboard event, such as pressing CTRL and V being identified as the "CTRL-V" character
right.

> It's easy to change the value of a key to match the value of any single ASCII character, but what if I want to use a two or three character combo, such as "ctrl-alt-v" or "a-b"… can that be done without hacking to much into the code ?

It's actually not as straight forward as you would think.  Some
combinations you could get if plymouth supported handling escape
sequences.  There was a discussion about doing that sort of thing in a
thread here:

http://lists.freedesktop.org/archives/plymouth/2010-September/000407.html

But I don't think you can get e.g., ctrl-alt-v with standard escape
sequences.  (totally willing to be corrected by someone if i'm wrong
though).

We could set the console keyboard mode with the KDGKBMODE ioctl to get
reports of individual key presses and releases, then we could track
modifiers like Alt internally.

Another option would be to change plymouth to use /dev/input for
keyboard input instead of going through the tty.  That's something
that's been talked about on quite a few occasions in the past.

So not that easy, but  possible given enough typing.

--Ray


More information about the plymouth mailing list