Re: onkey trapping

 BBS: Inland Empire Archive
Date: 06-29-92 (23:17)             Number: 1688
From: BREK WENDELN                 Refer#: NONE
  To: JIM TANNER                    Recvd: NO  
Subj: Re: onkey trapping             Conf: (2) Quik_Bas
 >> Does anyone out there know how to turn off the numlock
 >> key from within code? Right now I am just shelling a
 >> command to run a 46 byte .COM program that kills the
 >> numlock but I'd prefer to access this from within.
 >
 > Here's what I use.
 >
 > ============================================
 > This turns it OFF
 >
 > SUB NumLockOff
 > DEF SEG = &H40
 > POKE &H17, PEEK(&H17) AND (255 - 32)
 > DEF SEG
 > END SUB
 > =====================================
 > This turns it ON
 >
 > SUB NumLockOn
 > DEF SEG = &H40
 > POKE &H17, PEEK(&H17) OR 32
 > DEF SEG
 > END SUB
 > ==============================================
 >
 > This works on my 286 AT however I've noticed it does not
 > work on an old AMSTRAD XT clunker I keep around to test
 > my code on (if it works on it, it'll usually work on anything).
 >
 > If you or anyone else can tell me why it won't work on the
 > XT, I'd sure appreciate it.
 >
 > Later,
 >
 > Jim...
 >
Well I personally would use the following -- and it should
work on XT class machines:
==============================
SUB NumLockOFF
   DEF SEG = 0
   POKE &H417, PEEK(&H417) AND &H5F
   DEF SEG
END SUB
===============================
The above turns it off.  Below turns it on.
===============================
SUB NumLockO
   DEF SEG = 0
   POKE &H417, PEEK(&H417) OR &H20
   DEF SEG
END SU
================================


Brek



--- Opus-CBCS 1.73a
 * Origin: ODOT - District Seven - OPUS (1:108/55.0)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET