09-04-2003, 10:38 PM
09-04-2003, 11:01 PM
Alt-S is CHR$(0) + CHR$(31)
Alt-Q is CHR$(0) + CHR$(16)
You can write a simple program to find out other ones as well...
Alt-Q is CHR$(0) + CHR$(16)
You can write a simple program to find out other ones as well...
Code:
CLS
DO
k$ = INKEY$
IF LEN(k$) = 1 THEN
CLS
LOCATE 1, 1
PRINT k$ + " ";
LOCATE 2, 1
PRINT "CHR$(" + LTRIM$(STR$(ASC(k$))) + ")";
ELSEIF LEN(k$) = 2 THEN
CLS
LOCATE 1, 1
PRINT k$;
LOCATE 2, 1
PRINT "CHR$(" + LTRIM$(STR$(ASC(k$))) + ") + CHR$("+ LTRIM$(STR$(ASC(RIGHT$(k$, 1)))) + ")";
END IF
LOOP WHILE k$ <> CHR$(27)
09-04-2003, 11:16 PM
that will help hime alot thanx
09-05-2003, 04:39 AM
Ascii Alt-Q and ascii Alt-S do not exist.
What Plasma357 put in his answer are the INKEY$ function return codes.And that's not the same than the keyboard sacan codes, that would be different. But nothing is defined in ASCII for Alt-Q and Alt-S.
What Plasma357 put in his answer are the INKEY$ function return codes.And that's not the same than the keyboard sacan codes, that would be different. But nothing is defined in ASCII for Alt-Q and Alt-S.
09-05-2003, 06:42 AM
Right, Antoni, a very important point.
Said another way, QB can identify Alt-Q and Alt-S combination keys via the QB INKEY$ function. But these combination keys are NOT part of the Ascii character set, and INKEY$ has to identify these by using 2 bytes, where for a real Ascii character it only needs to use 1 byte.
As a matter of fact, if I'm not mistaken, none of the combinations with ALT are represented in Ascii code. This means that if you wanted to save the Alt-anykey combination anywhere on a file, for example, you would have to use a two byte scheme to do this, which could get very tedious.
*****
Said another way, QB can identify Alt-Q and Alt-S combination keys via the QB INKEY$ function. But these combination keys are NOT part of the Ascii character set, and INKEY$ has to identify these by using 2 bytes, where for a real Ascii character it only needs to use 1 byte.
As a matter of fact, if I'm not mistaken, none of the combinations with ALT are represented in Ascii code. This means that if you wanted to save the Alt-anykey combination anywhere on a file, for example, you would have to use a two byte scheme to do this, which could get very tedious.
*****
09-05-2003, 06:55 AM
It only gets tedious if you have to remake the function for each program... unless you use modules/libs....
One of my current programs supports two-character combos...... I'm using INP(96) for now... but it is a pain.......
One of my current programs supports two-character combos...... I'm using INP(96) for now... but it is a pain.......
09-05-2003, 09:25 AM
But Plasma's code handles two byte ASCII codes. You see the 'elseif'??? There you go