I try to read Shift + cursor keys combination (Shift+Left, Shift+Home, Shift
+Right, etc.) I wrote this small test program, when I press Shift+Enter,
Shift bit is set and stdin has key Enter, but when I press Shift+Left, Left
cursor key in stdin, but shift bit isn’t set, help me please !
I use defined constants in sys/dcmd_chr.h.
// _LINESTATUS_CON_SCROLL
// _LINESTATUS_CON_NUM
// _LINESTATUS_CON_CAPS
// _LINESTATUS_CON_SHIFT
// _LINESTATUS_CON_CTRL
// _LINESTATUS_CON_ALT
#include <stdio.h>
#include <errno.h>
#include <sys/dcmd_chr.h>
void main()
{
int Status;
int KeyStatus;
int RetStatus;
do {
RetStatus=devctl(fileno(stdin), DCMD_CHR_LINESTATUS, &KeyStatus,
sizeof(int), &Status);
if (KeyStatus!=0x00000000)
printf("\n%08X", KeyStatus);
KeyStatus=0x0000;
} while(1);
}
\
Mike Gorchak
CJSC Malva
System Programmer