[Top][All Lists]

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

Inconsistent behaviour of "keystatus" in a waiting loop

From: Arbiel (gmx)
Subject: Inconsistent behaviour of "keystatus" in a waiting loop
Date: Mon, 18 May 2015 22:24:00 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0


I wish to have grub wait until the user has taken a specific action and
presses down a key, such as control, shift or alt keys to inform the
action has been taken. It's possible to test this with the keystatus
--<key> function.

With the following lines

    echo "Press Ctrl key down to go on." ;
    until keystatus --ctrl ; do true ; done ;
    echo "Ctrl key pressed down." ;

grub seems to enter and endless loop. However, if the Ctrl key is
pressed before the "Press Ctrl key down to go on." message is displayed,
grub immediately exits the loop.


    until keystatus --alt ; do
        echo "Press Alt key down to go on" ;
        sleep -v 3 ;
        done ;
    echo "Alt key pressed down." ;

grubs exits the loop, however after a delay which seems to increase with
the number of "Press Alt down to go on" displayed before the alt key is
pressed down.

How can this behaviour be explained and what should I do to have grub
react at the pressing of the key ?


Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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