How would I turn numlock on and off in my progrqams? I want my program to "press numlock".
How would I turn numlock on and off in my progrqams? I want my program to "press numlock".
The world is waiting. I must leave you now.
I think the keystates are at 0x40,0x40-9x4f. You will need to check a ports listing like the one provided in RBIL or look up some docs on keyboard programming.
There are several approaches to this.
Hi There,
I used the following method with out any problem...
void main()
{
char far *f= (char far *)0x417;
*f=*f | 32; /* *f OR'ed with 32 */
}
Bit 6 (from 1) at location 0x417 holds the toggle value of the NUM LOCK. U set it to 1 then the NUM LOCK is ON and 0 would turn it off. Happy working...
best wishes,
Sriharsha.
Help everyone you can
hhmm kool.. now would i creat this in linux.. and what header file would i need to add...
O oo,
I've never checked it all with linux (or even unix for that matter). I am not sure if this would work in linux. If DOS and Linux have the same information at memory locations 0x317 then it should work else I guess u should find another way out.
NO HEADER file is needed for the program.
Do something, Press the num lock to off.
then run the program.
If it gets turned on then ur program is working (in Linux) But be careful there is a small catch here. Once the num lock is on, it would simply get turned OFF if u hit the numlock key. To get around this problem (in DOS) I wrote a small TSR that would get fired when ever the user presses any keyboard on the keyboard ( and in that routine, I always turned the NUM lock on).
Lemme know if u still have doubts (in DOS).
Regards,
Sriharsha
Help everyone you can
I'll try out the information in your replies vsriharsha. I am running in Windows 98SE console though. I've been sicker than a dog for the past who knows how long, so sorry for the wait on my responses ( and any errors as i still feel out of it ).
The world is waiting. I must leave you now.