For both F12 and Control-Page Up _getch() returns -122 (gotta love those signed char types :) )
This has so far been the only case where I've found duplicate scancodes, the compiler caught it when I tried to compile my project with the same "case -122:" statement.
Sorry about the late reply, I'm visiting family and am away from the house. :)
Anyways, I tried what you suggested and now the scan codes come back as what I would consider a sane value (no more negative numbers). But it still does the same thing (although I had to change my if and switch (case) statements to reflect the change from char to int).
Thanks for the suggestion though, it was a good idea.
I've been searching for web pages on keyboard scan codes and make/break codes but I haven't found a simple, definitive page.
It's been a long time since I did any of this stuff, but one solution that codes to mind is that you need to keep the status of the Ctrl/Alt/Shift keys in your program. Your program then has a couple of tables, one that maps scan codes to keys when no modifier keys are pressed, one that maps when Ctrl is pressed, etc.
I'm thinking that it has something to do with the newer keyboards (i.e. Windows keyboards).
It's not a big deal since (as the programmer) I can choose to use one or the other of the keys in my program. I'll just avoid using both in one program.
This issue really just sprang up because I was teaching myself C++ and I didn't like how cin, scanf, getc(har) worked. Or in other words, I got sidetracked. :)
If nothing else, I've got a pretty decent chunk of code that I can use as a function to allow me to read characters from the keyboard one at a time.
I'm interested is learning how I can keep track of the Ctrl/Alt/Shift keys in my program, I'll have to do some research on this.
Thanks for all of the help guys, I do appreciate it.
Okay I did a bit of checking around, and I guess what you are referring to is detecting Ctrl/Alt/Shift keys within Windows.
That's fine as far as that goes, and it's what I'll probably use eventually if I develop anything for the Windows side of the world (which is very likely).
I recall writing something in QuickBASIC years ago that would read the state of the keyboard flags. I'll see if I can dig it up once I get home.