Mail Archives: djgpp/1997/08/12/13:23:13
>>Hello,
>>
>>I was wondering if it is possible to turn the lights on the keyboard on
>>and off using functions in Allegro. I don't just want to activate or
>>deactivate the num lock and caps lock but I want to be albe to make
>>thier light flash on and off. There is a function for putting a
>>keypress in the buffer but I don't know if that would work.
>>Please give advice and please reply via email. I am no longer
>>subscribed due to the very large amount of mail that the mailing list
>>sends.
>I doubt if its possible, BUT if it is, could you post anything here and
>CC it to Jason.
>I'm almost certain if it is possible, the answer doesn't lie in Allegro,
>but in accessing the keyboards port directly. Doing something naughty
>like hitting the hardware directly, telling everything else thats
>running to shut up moaning I'm going to change the lights whether you
>like it or not.
Yes, you *CAN* turn on/off the keyboard leds, but not with Allegro.
I did this program a looong time ago, in pascal. It turns NumLock off
if its on.
Program TurnNumLockOff;
Uses Crt;
Var NumLock : Integer Absolute $0000: $0417;
Begin
NumLock := $0070;
Delay(1000);
NumLock := $0000;
end.
from what I remember, the 0000:0417 is the seg:offset where the values
of the num/caps/scroll/lock keys are stored, so changing the values at
that memory location will turn them on/off. Try some different values
and you should be able to make them blink :)
Offcourse that with djgpp you have to get the 0000:0417 address
translated to a 32bit address...
extacy/garbage
www.catalao.pt/coders/garbage/
ICQ#: 1906060
- Raw text -