Thread View: comp.os.msdos.programmer
4 messages
4 total messages
Started by Derek Lavine
Thu, 22 Oct 1998 00:00
Alternative to bioskey
Author: Derek Lavine
Date: Thu, 22 Oct 1998 00:00
Date: Thu, 22 Oct 1998 00:00
13 lines
871 bytes
871 bytes
Hi all, I need to use an alternative to bioskey() to read characters. I know I can use getch() but this does not pick up CTRL, INS, SHIFT, ALT, NUMLOCK etc. Does anyone know what function I can use. If there is not a DOS alternative is there a win32 API alternative Thanks Derek
Re: Alternative to bioskey
Author: Alexander Russell
Date: Wed, 21 Oct 1998 00:00
Date: Wed, 21 Oct 1998 00:00
24 lines
1462 bytes
1462 bytes
Under dos you can hook int9 (the keyboard hardware interrupt) for complete control. Under win32 the directX api has a number of different ways to get keyboard data, and there is also GetAsyncKeyState() for a int9 example soo common.zip at http://users.uniserve.com/~alexad3 Derek Lavine wrote in message <362EA84C.97C0DC8E@realware.com.au>... >Hi all, > >I need to use an alternative to bioskey() to read characters. I know I >can use getch() but this does not pick up > >CTRL, INS, SHIFT, ALT, NUMLOCK etc. > >Does anyone know what function I can use. If there is not a DOS >alternative is there a win32 API alternative > >Thanks > >Derek >
Re: Alternative to bioskey
Author: grafbobo
Date: Fri, 23 Oct 1998 00:00
Date: Fri, 23 Oct 1998 00:00
71 lines
2933 bytes
2933 bytes
In article <909033101.316451@neptune.uniserve.ca>,
"Alexander Russell" <alexad3@uniserve.com> wrote:
> Under dos you can hook int9 (the keyboard hardware interrupt) for complete
> control.
> >
> >I need to use an alternative to bioskey() to read characters. I know I
> >can use getch() but this does not pick up
> >
> >CTRL, INS, SHIFT, ALT, NUMLOCK etc.
> >
> >Does anyone know what function I can use. If there is not a DOS
> >alternative is there a win32 API alternative
> >
Check The State Of The Keyboard State Registers $0040:$0017/8.
An Old Example (Sorry, In Pascal):
Key_ShiftR = 1;
Key_ShiftL = 2;
Key_Ctrl = 4;
Key_Alt = 8;
Key_Scroll = 16;
Key_Num = 32;
Key_Caps = 64;
Key_Insert = 128;
Keyp_CtrlL = 1*256;
Keyp_AltL = 2*256;
Keyp_CtrlR = 4*256;
Keyp_AltR = 8*256;
Keyp_Scrll = 16*256;
Keyp_NumL = 32*256;
Keyp_CapsL = 64*256;
Keyp_SysReq = 128*256;
clrscr;
repeat
REPEAT
UNTIL (MEM[$0040:$0017]>0) OR (MEM[$0040:$0018]>0);
gotoxy(2,wherey);
write(MEM[$0040:$0017] AND 128 DIV 128:4);
write(MEM[$0040:$0017] AND 64 DIV 64:4);
write(MEM[$0040:$0017] AND 32 DIV 32:4);
write(MEM[$0040:$0017] AND 16 DIV 16:4);
write(MEM[$0040:$0017] AND 8 DIV 8:4);
write(MEM[$0040:$0017] AND 4 DIV 4:4);
write(MEM[$0040:$0017] AND 2 DIV 2:4);
write(MEM[$0040:$0017] AND 1 DIV 1:4);
gotoxy(42,wherey);
write(MEM[$0040:$0018] AND 128 DIV 128:4);
write(MEM[$0040:$0018] AND 64 DIV 64:4);
write(MEM[$0040:$0018] AND 32 DIV 32:4);
write(MEM[$0040:$0018] AND 16 DIV 16:4);
write(MEM[$0040:$0018] AND 8 DIV 8:4);
write(MEM[$0040:$0018] AND 4 DIV 4:4);
write(MEM[$0040:$0018] AND 2 DIV 2:4);
write(MEM[$0040:$0018] AND 1 DIV 1:4);
writeln;
if keypressed then c:=readkey;
until MEM[$0040:$0017] =255; { 3 }
Thomas.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Re: Alternative to bioskey
Author: George Swan
Date: Sat, 24 Oct 1998 00:00
Date: Sat, 24 Oct 1998 00:00
15 lines
1260 bytes
1260 bytes
In article <362EA84C.97C0DC8E@realware.com.au>, Derek Lavine <derek@realware.com.au> wrote: >Hi all, >I need to use an alternative to bioskey() to read characters. I know I >can use getch() but this does not pick up >CTRL, INS, SHIFT, ALT, NUMLOCK etc. You cross-posted this to Borland group, so presumably you are using a Borland compiler. The bioskey() in my BC++ 3.1 does allow one to check the status of CTRL, SHIFT, ALT, INSERT, NUMLOCK, CAPSLOCK etc. If you RTFM you will see you use a different argument to learn about these keys.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads