title: How to check if the CapsLock key is pressed? using C code or assembly
body: <p>I am programming an operating system and I want to handle the instruction. The code prints to the screen the letters pressed but I don't know how to check if the CapsLock key is pressed. I assume there is a port that contains its state.
  I have a function that can return the value of a port:</p>
  <pre><code>uint8_t port_byte_in (uint16_t port) {
      uint8_t result;
      asm(&quot;in %%dx, %%al&quot; : &quot;=a&quot; (result) : &quot;d&quot; (port));// Inline assembler syntax
      return result;}
  </code></pre>
  <p>I someone can help me find the needed port or have another idea of how to check if the CapsLock key is pressed that would be great : )</p>