onkey trapping

 BBS: Inland Empire Archive
Date: 06-26-92 (09:59)             Number: 1505
From: JIM TANNER                   Refer#: NONE
  To: BILL CAMPBELL                 Recvd: NO  
Subj: 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...

--- GEcho 1.00/beta
 * Origin: RiverBend | Osceola, AR | HST V32/V42b | (1:19/99)
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