Why specifying keyboard layout

keyboardkeyboard-layout

Most operating systems (if not all) asks about the keyboard layout during installation. Why do they need to know the layout? I mean, when pressing key, does the keyboard send a specific signal indicating what it represents (if so, why needing to specify the layout?) or it sends a signal indicating its position (the second raw, third key) and then the OS detects what key is that from the layout specified?

Best Answer

keyboards "send" numeric scancodes.

The operating system has to convert the scancode into an action or a displayable character.

For example, Shift+3 is the same scancodes on UK and US keyboards but needs to result in differing characters.

Related Question