0xEE
0xEE

Reputation: 11

Resolving Keyboard Scan Codes to the actual Character Inputted

I'm trying to make one of those programs that overlay the users input on screen and I ran into a problem I couldn't find a way to fix.

It's important to me, that the program can handle other keyboard layouts as well. Trying to figure out how to do it I looked at keyloggers, but none of the ones I looked at could correctly recognize what character was being inputted all of the time.

I was thinking that there are tables available for download, relating scan codes to keys for every keyboard layout. But that doesn't seem to be the way it works.

I would have guessed that this is a solved problem. If someone could nudge me in the right direction that would be wonderful. Ideally something that works cross platform.

Thank you

-- Edit --

  1. I'm assuming that this is standardized across platforms because a USB keyboard will send the same scan codes no matter which OS you're using. So I would guess there are tables or files that tell the OS which letter to input for a given combination of scan codes for a given keyboard layout.

  2. I'm not looking for a code snipped I can copy paste. I'm looking for how an OS translates the scan codes. If you only know how it works on a certain OS, just let me know anyways:) Id be happy to learn about it, even if it works different from OS to OS.

To be more specific, for example in Linux, how does the keyboard layout know which symbol to output(Step 3) https://wiki.archlinux.org/title/Keyboard_input

There has to be a standard that defines how a given keyboard layout should work. Where can I find this info?

Upvotes: 1

Views: 95

Answers (0)

Related Questions