🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #649

Re: Toggling NumLock (C source included)

#649
From: John Steele
Date: Mon, 28 Sep 1992 22:33
39 lines
1929 bytes
In <1992Sep28.163323.10278@digi.lonestar.org> kgallagh@digi.lonestar.org (Kevin Gallagher) writes:

>In article <27SEP199221155761@pavo.concordia.ca> m_rheau@pavo.concordia.ca (RHEAUME, MICHEL) writes:
>>As simple as it sounds, I can't think of a way to
>>toggle the NumLock key (through software of course!).

>The 1st Edition of PC Magazine's DOS Power Tools book comes with a disk
>containing two 46 byte com files entitled NUMOFF.COM and NUMON.COM.
>Unfortunately, they did not include the source.  However, I think these are
>probably available for download from the PC Magazine BBS.

Here's some Microsoft source to turn it off (should work under Borland's 
also, but I haven't tried it):

/*
 *  NUMOFF.C - Turns the NumLock off
 *
 *  cl -Ox numoff.c
 */

#if !defined(MK_FP)
#define MK_FP(seg,ofs)  ((void far *) (((unsigned long)(seg) << 16) | \
                        (unsigned)(ofs)))
#endif

main ()
  {
  *(int far *) MK_FP (0x40, 0x17) &= 0xDF;
  }

Enjoy,
  John
-- 
#include <disclaimer.h>			/* route all flames to /dev/null  */
/**************************************************************************/
/*   Systems Analyst      | John Steele     email: jsteele@netcom.com     */
/* Video Business Systems |                                               */
/*   1-800-255-3088       |    Most people spell COBOLSUX incorrectly...  */
/**************************************************************************/
Technical Details
Message-ID: <z2_p6fb.jsteele@netcom.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!wupost!decwrl!csus.edu!netcom.com!jsteele
References: <27SEP199221155761@pavo.concordia.ca> <1992Sep28.163323.10278@digi.lonestar.org>

Show Full Headers
Complete Article Headers
Newsgroups: alt.msdos.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!wupost!decwrl!csus.edu!netcom.com!jsteele
From: jsteele@netcom.com (John Steele)
Subject: Re: Toggling NumLock (C source included)
Message-ID: <z2_p6fb.jsteele@netcom.com>
Date: Mon, 28 Sep 92 22:33:57 GMT
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
References: <27SEP199221155761@pavo.concordia.ca> <1992Sep28.163323.10278@digi.lonestar.org>
Lines: 39