Hi,

I want to lit up toggle keys' status LEDs. Anyone please suggest me some methods. I know that the bits of the byte 0x417 keep track of the status of the keys whereas the bits of the byte 0x418 only monitor whether the keys are pressed or not.

The following code gives the status of those keys.


char byte=(char far*)0x417;
if(*byte&16)
	printf("Scroll lock is activated\n");
if(*byte&32)
	printf("Num lock is activated\n");
if(*byte&64)
	printf("Caps lock is activated\n");

But, this is not the thing I want.
The following code makes caps lock on, if it is off.

*byte+=64;

But, it doesn't make the light on.

What should I do?
I've posted the same thing in programming forums. But, I didn't get the solution.
Please help me.

@$|<

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.