-
getch and alt-extentions
Ok; I've been programming for awhile but this has me rather upset and I'm not getting anywhere. Here's the setup:
/*------------------*/
#include<stdio.h>
#include<conio.h>
int main(void)
{
unsigned char command;
while (1==1)
{
command = getch();
gotoxy(10,10);
printf("%X",command);
}
}
/*------------------*/
Now; this returns the hexadecimal code for any character entered. with a REALLY old compiler this gave different values for x and alt-x. With the newer ones (ie. Borland
5.5) I'm getting no alt-codes added into the return value... Can someone tell me just how to detect alt-x etc in a newer compiler? Thanks!
(ie Alt-Q) should return (0x10; or 0x00,0x10...)
-
Ack! Well I've been looking all day now; and can't find out any info on this subject. Does anyone here know? Or am I gonna have to write an entire keyboard handler? For some reason however I do get ctrl codes but ctrl-f and f just return 0x66... Anyone?? Please; I'm going nuts... Maybe I'll just write a handler or look for one...
-
In visual c and in several other compilers getch returns characters (including shift-character), function or arrow keys, so no alt keys, certainly not ctrl-c or such ctrl combinations what affect the program and are not supposed to be inputed.
-
Hmm; I get ctrl-c as a matter of fact... Just not the alt-combos which it was I want... So... Anyone ever write a keyboard handler? I guess from my understanding I have to just change the interrupt vector 9 to mine?