A Keyboard Scan Code or KeyCode is the numerical value or index, of the key on the keyboard which you type. [1]
An ASCII code [2] is used to determine the character to which that key should correspond. ASCII, American Standard Code for Information Interchange uses codepages to map characters to designated character codes. The first 128 of which are always the same, the last 128 of which vary depending on which code page is used. See Extended ASCII. [3]
All keyboards will pass their scan codes to the Computer connected to the keyboard, the computer will then interpret what has been input. In Windows, the KeyCode will be translated to ASCII using the specified IME [Input Method Editor].
Look at your keyboard now.
On a standard, English, QWERTY 101/102 key keyboard: [4]
The Key at the position of the letter 'Q' has the key code with the numerical value 17.
That key will always pass 17, regardless of the language of the keyboard.
So if you were to use a French keyboard which uses the layout AZERTY: [5]
The same key at the same position this time with the letter 'A' on it, will have the same key code 17. That key will always pass 17.
A keyboard, does not decide what the keys mean or do. A keyboard does not decide its language either, the Operating System of the computer will. All keyboards will inform the OS of the 'default' language namely the one that is printed on the keys, but the OS can ignore this and you can change this freely.
So, depending on the setting of the OS, the key code is received, then the IME translates that code into an ASCII code. So if your OS was set up with a UK or US English keyboard set, then key 17 would be mapped to the ASCII character 'Q', [ASCI: 81] or 'q' [ASCII: 113] depending n whether Caps Lock is pressed or not; or if you had a French keyboard it would be mapped to 'A' [ASCII: 65] or 'a' [ASCII: 97] again depending on Caps Lock. [7]
Also just to note here, a KeyCode stays the same regardless of Caps Lock or any other key's state e.g. Alt or Ctrl etc. The ASCII code associated with the key will be different depending on these states with some keys having 3 or 4 ASCII codes associated which change depending on other key states e.g. the E key can produce: E, É, e and é.
Operating systems have default IME lists for you to choose from, with more usually available with language packs etc, and there are programs you can download [6] that let you create your own key map so you can reorder your keyboard as you see fit, instructing the OS what to map each key code to.
In Windows 7 for example to change your IME you would:
Go to your control panel, by clicking start, then typing control panel and hitting enter.
Then go to regional and language options
Then click keyboards and languages and choose change keyboards
On the dialog you can click add, to add more keyboard mappings.
No matter what you language you change the keyboard to, the keys will always have the same key codes as they were programmed with when the keyboard was built. The ASCII code the key corresponds to will only change.