[comp.os.msdos.programmer] Num-Caps-Scroll Lock

swalker@uhunix1.uhcc.Hawaii.Edu (Sunny Walker) (11/13/90)

I am a new programmer and was wondering if it is possible to change the state
of the Num-Caps-Scroll Lock keys from a program, (id est, turn on/off Num Lock
(etc) without physically pressing the key(s) on the keyboard).

I can use Turbo Pascal 5.5 (preffered), Turbo C 2.0, MSC 4.2, Quick Basic ?.?,
or GW-BASIC.

Thanks in advance.

-------
Sunny Walker - swalker@uhunix1.uhcc.Hawaii.Edu
"Logic is a systematic method of coming to the wrong conclusion with *complete*
confidence." -- author unknown

hd7x@vax5.cit.cornell.edu (11/14/90)

In article <10264@uhccux.uhcc.Hawaii.Edu>,
swalker@uhunix1.uhcc.Hawaii.Edu (Sunny Walker) writes:
> I am a new programmer and was wondering if it is possible to change the state
> of the Num-Caps-Scroll Lock keys from a program, (id est, turn on/off Num Loc

ESR@SLACVM.SLAC.STANFORD.EDU (Ed Russell) (11/15/90)

In article <10264@uhccux.uhcc.Hawaii.Edu>,
swalker@uhunix1.uhcc.Hawaii.Edu (Sunny Walker) writes:
> I am a new programmer and was wondering if it is possible to change the state
> of the Num-Caps-Scroll Lock keys from a program, (id est, turn on/off Num Loc

Try a program named TOGGLE from PC Magazine BBS.

ts@uwasa.fi (Timo Salmi) (11/15/90)

In article <1990Nov14.053813.990@vax5.cit.cornell.edu> hd7x@vax5.cit.cornell.edu writes:
>In article <10264@uhccux.uhcc.Hawaii.Edu>,
>swalker@uhunix1.uhcc.Hawaii.Edu (Sunny Walker) writes:
>> I am a new programmer and was wondering if it is possible to change the state
>> of the Num-Caps-Scroll Lock keys from a program, (id est, turn on/off Num Loc

Yes.  And if you are using Turbo Pascal you can find the routines in
/pc/ts/tspas22.arc, available by anonymous ftp or mail server from
the archives uwasa.fi, Vaasa, Finland.  On the other hand if someone
needs a programs that does this, you can find it in
/pc/ts/tsutld18.arc.

...................................................................
Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

dcurtis@crc.ac.uk (Dr. David Curtis) (11/15/90)

>In article <10264@uhccux.uhcc.Hawaii.Edu>,
>swalker@uhunix1.uhcc.Hawaii.Edu (Sunny Walker) writes:
>> I am a new programmer and was wondering if it is possible to change the state
>> of the Num-Caps-Scroll Lock keys from a program, (id est, turn on/off Num Loc

In Zortech C:

#include <dos.h>

main()
{
char state; /* maybe this shoud be unsigned char */
peek(0x0,0x417,&state,1); /* get keyboard status byte */
state &= ~0x20; /* Num lock bit off */
poke(0x0,0x417,&state,1);
}

This turns off my Num lock key when I boot up.


Dave Curtis

Academic Department of Psychiatry,    Janet:       dc@UK.AC.UCL.SM.PSYCH
Middlesex Hospital,                   Elsewhere:   dc@PSYCH.SM.UCL.AC.UK
Mortimer Street, London W1N 8AA.      EARN/Bitnet: dc%PSYCH.SM.UCL@UKACRL
Tel 081-380 9475 Fax 081-323 1459     Usenet: ...!mcsun!ukc!mrccrc!D.Curtis