Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Num Lock processing is wrong in Scan Code Set 2 #26

Closed
thejpster opened this issue Feb 4, 2023 · 1 comment
Closed

Num Lock processing is wrong in Scan Code Set 2 #26

thejpster opened this issue Feb 4, 2023 · 1 comment

Comments

@thejpster
Copy link
Member

We thought PrntScr produced a make code of E0 12 E0 7C in Scan Code Set 2. Actually, it's more complicated.

The keys Insert, Delete, Left Arrow, Home, End, Up Arrow, Down Arrow, Page Up, Page Down and Right Arrow should do different things on your computer depending on whether Num Lock is enabled and the state of the shift keys. Blame the IBM PC/AT trying to be compatble with the IBM PC/XT. I think?

If Num Lock is ON and both shift keys are released, the make code is prefixed with E0 12 and the break code is prefixed with E0 F0 12. If you press shift, you don't get the E0 12 prefix. This is because if you do a Shift Insert with Num Lock on

So we should treat E0 12 as an extra modifier key called Unshift and track its state, but probably not allow its state to change anything about the key decoding.

Observations

  • PrtScr produces E0 12 E0 7C
  • PrtScr with shift pressed produces E0 7C
  • PrtScr with control pressed produces E0 7C

(the above is regardless of numlock state)

  • With Num Lock off, Insert produces E0 70 regardless of shift
  • With Num Lock on Insert produces E0 12 E0 70
  • With Num Lock on and shift pressed Insert produces E0 70
  • With Num Lock on and control pressed Insert produces E0 12 E0 70

References

http://www.quadibloc.com/comp/scan.htm - refers to unshift
"Keyboard Scan Code Specification - Microsoft" - See Note 2 for Scan Code Set 2 and Note 4

@thejpster
Copy link
Member Author

thejpster commented Feb 6, 2023

Closed by #27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant