TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: PAUL ELLIOTT
from: KURT KUZBA
date: 1997-04-11 14:16:00
subject: Detecting...

PE>   Is they any (easy?) :) way of detecting if the scoll lock
PE>   key is turned on or off? Or the caps lock key?
PE>   I'm writing a small program for proboard that will look
PE>   at either of these two keys and then present a message
PE>   accordingly depending on the status of the two keys.
pe>....
   Are we to assume DOS and C then?
The BIOS keeps a record of the shift status at 0x00400017L.
int Rshift(void) {   return   1 & *((char*)0x00400017L;   }
int Lshift(void) {   return   2 & *((char*)0x00400017L;   }
int Ctrl(void)   {   return   4 & *((char*)0x00400017L;   }
int Alt(void)    {   return   8 & *((char*)0x00400017L;   }
int Scroll(void) {   return  16 & *((char*)0x00400017L;   }
int Num(void)    {   return  32 & *((char*)0x00400017L;   }
int Caps(void)   {   return  64 & *((char*)0x00400017L;   }
int Insert(void) {   return 128 & *((char*)0x00400017L;   }
if(Scroll() && Caps())
> ] When this message is over, you will awake feeling refreshed.
---
---------------
* Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.