What was the intention behind making the two sets of numbers different?

Apparently the number keys located above the main keyboard send different codes than their matching keys in the numeric keypad do. (At least, if you set your Windows password to ‘123’ using the top row keys, typing ‘123’ on the keypad will not be accepted as I belatedly discovered.)

I’ve got to assume this was done deliberately, but I don’t see the benefit, just inconveniences. What problem was supposed to be solved/averted by doing this?

Does this “not really the same” factor hold true for other ‘duplicates’, like the right/left shift keys, left/right conrol keys, the / keys, the two ways of typing + and * and - and .?

Hmmmm.

Do you have one of those keyboards with a “Num-Lock” feature? The feature which has the numeric keypad doubling as a set of cursor control keys? Perhaps that’s what’s going on. You don’t have Num-Lock enabled.

Another possibility is that you have the wrong “key map” selected. This is a setting in the operating system that specifies how physical keypresses are mapped to characters. I couldn’t tell you where to find this setting in Windows, but it’s in there somewhere.

Otherwise, the keypad keys should deliver the same character codes, though not the same key codes, as their counterparts in the main section. There are ways of distinguishing the two types of keypresses in software, but that’s normally only done in games or other programs that care about physical keys. I’m speaking generically here, and not just about Windows/Intel machines specifically.

And yes, there’s also usually a way to tell whether the left shift key is pressed versus the right shift key, and likewise for other modifier keys. Again, a program should only be checking this when the distinguishing of physical keys makes sense to the interface, as in a game. For text entry, it doesn’t make sense to.

No, they are giving different codes. Try this:

Hold down ALT and press 0151 at the top of the keyboard. Nothing will happen (my computer beeps at me).

Now, hold down ALT and press 0151 on the numeric keypad. You’ll get this: — The em dash.

Obviously the two keypads send different information to the computer.

The reason was probably to give programmers further options.

Trying Windows password with numbers over the letters and with the numeric pad works the same for me. Just be sure Num Lock is on.

By the way, take it from a professional - “123” is a lousy password. :cool:

:stuck_out_tongue: [sup]What kind of professional?[/sup]

How odd. I have no ALT key on my keyboard.
I do have ‘option’ and a nice big apple key. Only one button on my mouse, too.

In my extensive experience: In certain applications (Quark Xpress, f’rinstance), you can assign keyboard shortcuts to paragraph or character styles. When choosing your shortcuts, the number pad key is DEFINITELY different from the top row number keys - if you’re not careful you’d type in a phone number on the wrong set of keys and re-format your paragraph seven times but not actually type any character into the text block.

I hope this makes sense - the keys are definitely different flavors.

Well, the minor mystery is solved. Bytegeist is right, I do have a keyboard with a numlock key. I was sure that that couldn’t be the cause, because the computer starts up with the numlock key on.

However…just now I was paying closer attention, and I saw that the numlock light was NOT on at the point where it asked for my password. Aha! I click the numlock, type in my password (passnumber?) and all is sweetness and light.

Obviously the command to switch numlock on come somewhat later in the bootup sequence, and I just hadn’t noticed.

Doesn’t really explain why they didn’t just make the keys send identical codes. Look at Stockton’s post for the idiocy that can result from the current system.
Oh, and btw Gotpasswords, I’m not silly enough to use 123, that was just an example. My passnumber is actually 321. (Shh! Don’t tell!)

Hey! That’s MY password!

Stockton’s on a Mac

[Technical]
It’s because they are different keys on your keyboard and each key emits a different “scan code” regardless of whatever is marked on it. The computer then interprets the “scan code”. There are good reasons for doing this.

[A Good Reason for Scan Codes]
You might want the number 1 when pressed in one application to mean a different thing than when pressed in another application. (Sometimes you want it to type the character “1”, sometimes you want it to select the first option.)

[A Good Reason for Having Unique Scan Codes]
You might want an application (say… a computer game with MANY options) that would interpret the “1” on the keyboard’s top row differently than the “1” in the numpad. (Say, the former switches weapons and the latter switches cockpit views.)

It used to be that if you wanted to change the default state of num/caps/scroll lock, you had to edit the BIOS settings, but Windows XP now seems to remember the last configuration for each user.

Some say the different code for each key is intended to provide greater flexibility for programmers. For example, long ago some game used the large and symmetrical Shift keys on either side to turn right or turn left.

I think it wasn’t worth it. I’ve used enough programs in the past that did not interpret the numeric keypad keys as numerals that it has trained me not to use them, but to type numbers on the upper row (though amusingly enough typing ASCII characters by their decimal codes ONLY works on the keypad). Or for instance I think the old Norton Commander only selected all files when one of the + keys was typed, not the other (IIRC). So it’s just more mental baggage to learn the habits that most often work.

>By the way, take it from a professional - “123” is a lousy password.

Gee, betcha StarvingButStrong feels pretty silly… unless, of course, that was an example…

Guys (and gals), you’re mixing a LOT of different issues here.

First off, let’s set aside the Mac’s. Fine machines, but not what the OP’s talking about.

As others have sort of said indirectly, there are two different pieces of info that are generated when a key is pressed.

The keyboard itself transmits a code, called the scan code, which defines which physical button was pushed, and each shift key, alt key, control key, number key, etc., has a different scan code. At that level, the 4 above the ER keys and the 4 on the numeric pad are two utterly unrelated buttons. Likewise left shift and right shift are two different and unrelated buttons.

That scan code gets sent to some programming built into the PC called the keyboard BIOS. The BIOS diddles with it and sends it along to the OS, in this case Windows.

Windows in turn converts the scan code into a character code. At that point, the two 4 keys become indistinguishable, LeftShift and “a” together become “A”, and that’s also where non-US keyboard characters get mapped. For example, on German keyboards, something like LeftCtrl+e = e with unlaut.

A Windows program can just accept the pre-digested characters. That’s the norm with your browser, Word, etc. About 99% of the programs the typical user encounters work this way.

But, if the program wants to, it can dig into the scan codes so it can tell which 4 was pressed. As others have said, normally it’s games and CAD and other special purpose programs that do that. Restaurants, where PCs serve as combo cash registers & ordertaking stations, often have weirdball keyboards with 1 dedicated button for each menu item. This is another example of a place where accessing the scan codes makes sense. Those weirdball keyboards do NOT behave like typical PC QWERTY boards and have very different scan code sets.

As well, a program can dig a little deeper and react to the key being pressed, and react again to the key being released. Those are two different actions. A typical Windows program reacts to the key press and ignores the key release.

It’s kind of fun to alter that behavior and make programs react to key release instead. If you type while looking at the screen, you’ll be utterly crippled. Funny how something so small makes such a huge difference in human perception of the task.

Last of all, turning to the ALT + numeric pad mystery.

As part of the Keyboard BIOS spec of the original PC, a feature was added for creating any character code, even those for which there wasn’t a button on the keyboard.

That feature is implemented by pressing either alt key and typing the 3 digit code from 000 to 255 on the numeric pad. The keyboard BIOS would interpret that specific “chord” a special way and provide the appropriate character code.

Pressing an alt key and typing 3 digits on the keys above the alphabet does NOT trigger that feature and instead transmits the codes for, say, Alt-1, Alt-4, and Alt-5 in turn.

A few years ago, the BIOS standard was updated as part of the ongoing internationalization of the PC and the advent of Unicode to supplant ASCII. Now, character codes aren’t 8 bits = 1 byte = 256 possibilities, but rather 16 bits = 2 bytes = 65536 possibilities (slight simplification here).

And the keyboard BIOS now processes Alt+4 digits on the numeric pad as a single Unicode character. That still only covers some 9999 codes,. but it’s alot more than the old 256.

And that’s why pressing Alt and 0-1-5-1 on the numeric pad produces an em dash. You can press Alt + 0065 and get an “A”. At the character code level, that “A” is indistinguishable from the conventional shift+“a” “A”. But dig deeper and there’s a lot of difference.

There’s a whale of a lot more going on inside a PC keyboard than there was on a manual or even electric typewriter.

Seque back to Macs: All the same sorts of things are happening in a Mac keyboard too. The terminology is different, the code values are different, but the idea is the same. A string of button presses and releases is translated through multiple levels of software to some set of codes that can be interpretted as letters and numbers and symbols.

Thank you, LSLGuy – that was very enlightening.
I guess I will forgive them for the way they decided to do things.

And from a historical (not technical) perspective, there was a reason for the numeric pad, as well. Early machines/keyboards tended to have the numbers along the top, following the convention of typewriters However, bean counters tend to be more comfortable using the keypad layout to enter long strings of numbers. The numeric keypad was added on the right side (with a presumption of right-handed users) to accommodate accountants and others who wanted faster data entry. (This change actually preceded the development of the PC and can be found on ancient mainframe keyboards. The even earlier data entry keyboards emulated a “numeric keypad” by clustering the numbers on the right hand side of the keyboard, selected with a numeric control key.) When PCs came along, the 101+ key keyboard with two sets of keys for numbers was already in widespread use. The designers simply kept all the keys (so as not to offend any potential users) then made use of the “extra” keys by assigning different signal characters depending on the mode in which one was typing).

Adding to Tom~'s point, it’s worth noting that in the early days of keyboard manufacture, shortly after the woolly mammoth went extinct, one had the 84-key keyboard without separate keys for the four arrow keys, PgUp, PgDown, Home, and End; these were duplicate functions assigned to the ten-key numeric keypad and toggled back and forth between those functions and the numbers by use of the NumLock key. That dual functionality is preserved today on most keyboards, even though they also have the separate keys for those functions.