[ipxe-devel] [ipxe/ipxe] simple uefi usability fix (#38)

Michael Brown mcb30 at ipxe.org
Sun May 8 00:52:26 UTC 2016


On 07/05/16 16:12, Dreamcat4 wrote:
> OK sorry. This has been explained to me properly on IRC now:
>
> 13:57 If you are using a USB keyboard, then you can work around the
> broken UEFI firmware by using iPXE's own USB keyboard driver
> 13:57 (instead of the UEFI keyboard driver)
> 13:58 You can trivially verify the the problem is independent of iPXE by
> e.g. booting straight into the UEFI shell
> 13:58 You will find that, for example, "Ctrl-C" acts as just "C"
>
> Which is great. It would be even better to know / have documented
> somewhere (relevant places) how users can do that!

You could also try this patch:

diff --git a/src/core/getkey.c b/src/core/getkey.c
index 0f0f8b7..0c280d2 100644
--- a/src/core/getkey.c
+++ b/src/core/getkey.c
@@ -76,9 +76,14 @@ int getkey ( unsigned long timeout ) {
  	if ( character != ESC )
  		return character;

+	character = getchar_timeout ( GETKEY_TIMEOUT );
+	if ( character < 0 )
+		return ESC;
+
+	if ( isalpha ( character ) )
+		return ( toupper ( character ) - 'A' + 1 );
+
  	while ( ( character = getchar_timeout ( GETKEY_TIMEOUT ) ) >= 0 ) {
-		if ( character == '[' )
-			continue;
  		if ( isdigit ( character ) ) {
  			n = ( ( n * 10 ) + ( character - '0' ) );
  			continue;

which should allow you to emulate Ctrl-<key> by pressing ESC,<key> (with 
less than 0.25s between ESC and the other key).

Michael



More information about the ipxe-devel mailing list