I just wrote an entire translation table for scancode set 3 and made sure that i switched the keyboard to use set 3. However, i still recieve set 2 scancodes.
To add to that, i get the ACK response even if the keyboard doesn't seem to change its set. What should i do?
Problem with scancodes
-
- Member
- Posts: 5578
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Problem with scancodes
Probably you should stop trying to use set 3.
What are you running your OS on? If you're running on bare metal, what kind of keyboard are you using?
What are you running your OS on? If you're running on bare metal, what kind of keyboard are you using?
Re: Problem with scancodes
I'm running my OS on virtualbox.
-
- Member
- Posts: 5578
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Problem with scancodes
Virtualbox appears to support scan code set 3. How are you switching the keyboard to set 3? If you ask the keyboard which set it's using, how does it respond?
Re: Problem with scancodes
The output of that command is 3F.
outb(PORT_NB_PS2_DATA, 0xF0);
outb(PORT_NB_PS2_DATA, 3);
outb(PORT_NB_PS2_DATA, 0xF0);
outb(PORT_NB_PS2_DATA, 0);
outb(PORT_NB_PS2_DATA, 0xF0);
outb(PORT_NB_PS2_DATA, 3);
outb(PORT_NB_PS2_DATA, 0xF0);
outb(PORT_NB_PS2_DATA, 0);
-
- Member
- Posts: 5578
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Problem with scancodes
You are not receiving set 2 scan codes. You are receiving set 1 scan codes.
The keyboard is sending set 3 scan codes, and the keyboard controller is translating them to set 1 scan codes. If you want to receive set 3 scan codes, you need to turn off translation in the keyboard controller.
Incidentally, when you ask the keyboard which scan code set it's using, it responds with 0x03 and the keyboard controller translates that into 0x3F.
The keyboard is sending set 3 scan codes, and the keyboard controller is translating them to set 1 scan codes. If you want to receive set 3 scan codes, you need to turn off translation in the keyboard controller.
Incidentally, when you ask the keyboard which scan code set it's using, it responds with 0x03 and the keyboard controller translates that into 0x3F.
Re: Problem with scancodes
Thanks a lot!!!!!
Have a nice day
Have a nice day