if (!num_lock_is_on)
{
  kbd_state.fs = apply_bit_mask (lock_on, locks_off, B_OR),
  {
    lock_on = KBD_NUMLOCK
  }, {
    locks_off = apply_bit_mask (kbd_state.fs, turn_off, B_AND), 
    { 
      turn_off = apply_bit_mask (KBD_CAPSLOCK | KBD_SCROLLLOCK, B_NOT) 
    }
  }
}