Checking for CAPS LOCK key enabled or not in C#

With Console.CapsLock we detect whether caps lock is enabled on the computer.
This property cannot be assigned.
If you need to turn caps lock off, you will need to instruct the keyboard user to press it again.

The Console.CapsLock property could be used in several different ways. If a program is requiring a password to be entered, you could print an error message if caps lock is pressed and the password is incorrect.

using System;
using System.Threading;

namespace forgetCode
{
    class Program
    {
        static void Main(string[] args)
        {
            Thread.Sleep(1000);
            bool capsLock = Console.CapsLock;
            Console.WriteLine(capsLock);
            
        }

    }
}


Output:
True or false (depending on the caps lock key pressed on computer)

..