Num/Caps/Scroll - Lock

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Hornet

Num/Caps/Scroll - Lock

Post by Hornet »

Hello.
How can i activate the Num/Caps/Scroll Lock LEDs in Protected Mode?

thx Hornet (german)
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:Num/Caps/Scroll - Lock

Post by df »

you dont. they are toggles, you have to keep the state yourself. and have your keyboard driver interpret keypresses based on its state.
-- Stu --
chrisa128

Re:Num/Caps/Scroll - Lock

Post by chrisa128 »

Hi,

To actually get the LEDs to light up you have to send a command to the keyboard, here is the one from my Keyboard Driver....

Code: Select all

      write_kbd(0x60, 0xED);         temp = 0;
      if(kbd_status & KBD_META_SCRL)
         temp |= 1;
      if(kbd_status & KBD_META_NUM)
         temp |= 2;
      if(kbd_status & KBD_META_CAPS)
         temp |= 4;
      write_kbd(0x60, temp);   
      return 0;
The first line tells the keyboard u want to turn the LEDS on/off. The other checks to see which LED you want to set. The last line sets it. The bottom three bits actually tells it the led.

Hope this helps,
Post Reply