Programming Numlock and ScrollLock


I need to program some software to listen/test for either of Numlock, scrolllock or caps LED's or the on/off states. The OS is linux. The software runs under linux. The language is similar to basic and C. Does anyone know what scancodes these buttons are or how I might go about doing this?

The software takes input from the keyboard(programmable type) and depending on this input, processes it in a particular way.
All the keys are programmable. The Scroll/Num/Caps define the
levels. I need to test for what level, and also to tell the system that it is to go to a particular level. I also need to test for a combination of Caps/Scroll/Numlock states.

Any help would be greatly appreciated.


  • Well, in general the status of the keyboard LEDs is saved in the keyboard statusword.It is located in memory at 0040:0017h.
    The Bits 3-5(Im not sure,try it) control the LEDs.When this BITs are set,the LED is on.IMPORTANT: Don`t change the other bits,or your machine may crash,and the keyboard doesnt work properly until reboot.But Im not sure wether you could access BIOS-segment under LINUX (PROTECTED MODE!!!).But Im sure it works in Realmode or Ring-0 from protected mode.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion