Skip to contentSkip to conversation

mpc5xxx keyboard BUG found

DISCUSSION Igor Luri 2 participants 2 messages Mar 17, 2006

lore
Share & tools
lore

Igor Luri

author
#0 lore raw

We have an MPC5200LiteB board with a Microsoft USB keyboard atached and we have realized that some keys don't work properly, like up, down, lef and right arrows, PageUp, PageDown etc.

We have found that when those keys are pressed, first it sends a special scancode 0xe0 and then pressed key scancode.

Modifiying mpc5xxx_translate function to ignore the first scancode

                // special prefix scancodes..
                 if (scancode == 0xe0 || scancode == 0xe1) {
                       return 0;
                 } 

our keyboard works well. Other cpus ignorates this special scancode or it evaluates.

Now, mpc5xxx_translate looks like this:

int mpc5xxx_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode)
{

// special prefix scancodes..

 if (scancode == 0xe0 || scancode == 0xe1) {
       return 0;

}

//0xFF is sent by a few keyboards, ignore it. 0x00 is error if (scancode == 0x00 || scancode == 0xff) {
return 0;
}
*keycode = scancode;
return 1;
}

#1 lore raw
Quoted 3 lines · Igor Luri

We have an MPC5200LiteB board with a Microsoft USB keyboard atached and we have realized that some keys don't work properly, like up, down, lef and right arrows, PageUp, PageDown etc.

Hi!

Actually that Microsoft keyboard is working fine. A rare exception. ,-) For more information see chapter 1.3 from here:

http://www.win.tue.nl/~aeb/linux/kbd/scancodes.html

So basically you will have to handle those in the application level code.

- Jarno