"F" Keys

Status
Not open for further replies.

equazcion

Beta member
Messages
5
This is a random musing, but I was editing some hex code and I happened to glance at my keyboard's "F" keys. They look like HEX. My curiosity got the better of me, as it always does.

I searched the internet but could find nothing on the origin of those keys' labels. I mean most people call them "Function" keys, but I wanted a definitive answer, and found none.

I also did some math. My hypothesis is that back in "the day", the F keys were added after everything else as generic keys, just in case. If all possible transmit codes are enumerated in HEX, F1 is probably the next number in the HEX sequence after the last keyboard function.

The decimal equivalent of F1 is 241. That means that we must account for 240 keyboard "codes", without using the F keys, in order to prove the hypothesis. I'm accounting for the fact that the F keys were developed during a simpler time, and I'm hoping that aside from Ctrl-Alt-Del, the Ctrl and Alt keys were not used in the same keystroke. It's a reasonable assumption -- there was no need for "global" hotkeys in a single-thread environment.

Anyway, here's how the math went. And by the way if you're still reading, you're cool.

26 letter
26 shift+letter
26 ctrl+letter
26 alt+letter
21 numbers and symbols (no space bar yet)
21 shift+number and symbols
21 ctrl+number and symbols
21 alt+number and symbols
-------------------------------------
188 Subtotal

23 operator keys: ctrl, alt, shift, esc, backspace, ins, home, end, del, pgup, pgdn, 4 arrows, pntscrn, scroll lock, pause, numlock,tab,capslock,enter,space
18 ctrl+operator: (no ctrl,alt,shift,capslock,numlock)
18 alt+operator: (no ctrl,alt,shift,capslock,numlock)
1 ctrl+alt+del
------------------------------------
250 Total

Close enough for a possibility... My numbers probably aren't that accurate since I don't have a clue as to what functions and keys were available when the keyboards with F keys first came out. Also, I know each key combo doesn't exactly have its own code... so sue me, I'm bored :)

Still though, I'm curious, so if anyone has any answers about this I'd certainly enjoy hearing them. Thanks :)
 
I think you're math is off a bit. You don't count "CTRL+ALT+DEL" or any key combinations like that. They don't produce a new key code, they're just a combination of keys.
Also, I think you're reading a bit too much into the F1-12. Those are simply Function keys. They're used to execute variable functions, they're not hex.
Here's a chart that may help with HEX to char:
http://www.lookuptables.com/
 
Been a while since i did this but if i remember correctly this is how it works:

When you hit a key on the keyboard it matches the key to the codepage and creates a scancode which interrupts the system. By using different codepages you can then change the keyboard layout so that different keys mean different things.

It does infact all work in hex, although when Iron_cross said it doesn't i think he was meaning the F1 key does not corespond to the decimal value of F1(Hex), e.g.:

F1(Hex) = 241(Decimal) where as the F1 key is actually numbered 112(Dec) and returns a scancode of 05(Hex) on an AT keyboard, although the scancode may be different depending on the keyboard type

When you hit a key it repeats until you let go - a good few years ago if you held down a key for a while it would start to click, this was because you were filling the buffer too quickly and the computer was not able to process all of the interrupts from the keyboard.

Keys like Ctrl do not add to a keys value as you suggest, they are infact checked for by if or case statements. So on a key press it will check to see if any of these keys were also pressed at the same time and retrive the value from the codepage accordingly.
 
fitzjj said:
Been a while since i did this but if i remember correctly this is how it works:

When you hit a key on the keyboard it matches the key to the codepage and creates a scancode which interrupts the system. By using different codepages you can then change the keyboard layout so that different keys mean different things.

It does infact all work in hex, although when Iron_cross said it doesn't i think he was meaning the F1 key does not corespond to the decimal value of F1(Hex), e.g.:

F1(Hex) = 241(Decimal) where as the F1 key is actually numbered 112(Dec) and returns a scancode of 05(Hex) on an AT keyboard, although the scancode may be different depending on the keyboard type

When you hit a key it repeats until you let go - a good few years ago if you held down a key for a while it would start to click, this was because you were filling the buffer too quickly and the computer was not able to process all of the interrupts from the keyboard.

Keys like Ctrl do not add to a keys value as you suggest, they are infact checked for by if or case statements. So on a key press it will check to see if any of these keys were also pressed at the same time and retrive the value from the codepage accordingly.

Exactly. That's what I was trying to get across, thanks fitzjj ;)
 
Status
Not open for further replies.
Back
Top Bottom