5

Sorry for the blatant display of ignorance, but what exactly is a key code? I'm setting the timeout length in my vimrc, and reading about timeoutlen and ttimeoutlen. There's a distinction between key-mappings and key codes, but I'm not clear what a key code is.

8

On my keyboard, when I type in QWERTY, when I press the "H" key, I get an "H." In contrast, when I'm in Dvorak mode and I press the "H" key, I get a "D." The keyboard is sending the exact same key-code to the computer, but the computer maps the key to a different letter based on the typing mode (in this case, QWERTY vs Dvorak).

In this example, the key-code for the "H" key on the keyboard is 0x48, or "72" in decimal. The key mapping is determined by the software (the OS, the text editor, the game, etc) to determine what key-code maps to what function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.