Skip to contentSkip to conversation

Keyboard bugs

DISCUSSION Andrew Apted 2 participants 2 messages May 8, 2006 – May 9, 2006

lore
Share & tools
lore
#0 lore raw

Hello,

I've noticed a couple of bugs in the keyboard handling of GRUB2:

(1) in kern/i386/pc/startup.S, grub_console_checkkey() doesn't translate the code like getkey() does.

Personally I think the checkkey() API would be better as a simple boolean value.

(2) the grub_console_getkey() and checkkey() return value contains junk (the scan code) in the upper byte.

I think the return value should just be a Unicode character, and the GRUB_TERM_ASCII_CHAR macro should go away (at first I thought was a "unicode chop" function, but the real purpose is to discard the scan-code part).

Cheers,
--
Andrew Apted <[email protected]>

#1 lore raw
Quoted 2 lines · Andrew Apted

(1) in kern/i386/pc/startup.S, grub_console_checkkey() doesn't translate the code like getkey() does.

This is not a bug, because we don't interpret the return value as a scan code. As long as the return value is greater than or equal to zero, there is no problem.

Quoted 2 lines

Personally I think the checkkey() API would be better as a simple boolean value.

I can agree with this, although the priority is not high.

Quoted 8 lines

(2) the grub_console_getkey() and checkkey() return value contains junk (the scan code) in the upper byte.

I think the return value should just be a Unicode character, and the GRUB_TERM_ASCII_CHAR macro should go away (at first I thought was a "unicode chop" function, but the real purpose is to discard the scan-code part).

However, we cannot say that it is a unicode char, because unicode does not define control codes. I bet that it is better to keep the current way, because this is more flexible.

Thank you for your suggestions, anyway.

Okuji