(
Char
RAW Input/
Output)
LONG Crawio( ch )
WORD ch;
Crawio() combines console input and output in one function. Special keys like
Control-C are not processed.
Opcode
6 (0x06)
Availability
Parameters
ch is a
WORD value, however, only the lower 8 bits are meaningful and the upper 8 bits should be set to
0. If
ch is
0x00FF on input,
Crawio() returns the character read from
GEMDOS handle
0 (normally
'con:').
Binding
move.w ch,-(sp)
move.w #6,-(sp)
trap #1
addq.l #4,sp
Return Value
If
ch is
0x00FF upon entry,
Crawio() returns a bit array arranged as follows:
Bits 31-24 |
Bits 23-16 |
Bits 15-8 |
Bits 7-0 |
Shift key status(see below) |
Keyboard scancode |
Unused (0) |
ASCII code of character |
The
ASCII code of the character will be
0 if a non-ascii keyboard key is struck.
If no character was waiting in the input stream,
Crawio() returns a
0.
When using this function while its handle is redirected,
MiNT returns
MINT_EOF (
0xFF1A) when the end-of-file is reached.
Caveats
When using this function while its handle is redirected, an end-of-file condition will hang the system.
GEMDOS version 0.30 and all
MiNT versions correct this bug.
Due to the definition of this call it is impossible to write 0x00FF to the output stream or read a 0 (zero) from this call.
Comments
The shift key status will only be returned when bit 3 of the system variable conterm (char *(0x484)) is set. This is normally not enabled.
If the handle has been redirected, the inputted character will appear in the lower 8 bits of the return value.
Under normal circumstances, when
GEMDOS handle
0 is being read from, no special system keys, including
Control-C, are checked.
See Also