Problem with scancodes

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
aphexia
Posts: 17
Joined: Wed Jan 08, 2020 8:09 pm
Libera.chat IRC: aphexia

Problem with scancodes

Post by aphexia »

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?
Octocontrabass
Member
Member
Posts: 5578
Joined: Mon Mar 25, 2013 7:01 pm

Re: Problem with scancodes

Post by Octocontrabass »

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?
aphexia
Posts: 17
Joined: Wed Jan 08, 2020 8:09 pm
Libera.chat IRC: aphexia

Re: Problem with scancodes

Post by aphexia »

I'm running my OS on virtualbox.
Octocontrabass
Member
Member
Posts: 5578
Joined: Mon Mar 25, 2013 7:01 pm

Re: Problem with scancodes

Post by Octocontrabass »

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?
aphexia
Posts: 17
Joined: Wed Jan 08, 2020 8:09 pm
Libera.chat IRC: aphexia

Re: Problem with scancodes

Post by aphexia »

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);
Octocontrabass
Member
Member
Posts: 5578
Joined: Mon Mar 25, 2013 7:01 pm

Re: Problem with scancodes

Post by Octocontrabass »

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.
aphexia
Posts: 17
Joined: Wed Jan 08, 2020 8:09 pm
Libera.chat IRC: aphexia

Re: Problem with scancodes

Post by aphexia »

Thanks a lot!!!!!

Have a nice day :)
Post Reply