

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Check if Caps Lock and Num Lock is on or off through Console in C#
<p style="">To check if Caps Lock is on or off through Console, the code is as follows −</p><h2>Example</h2><p><a class="demo" href="http://tpcg.io/cFW1VRwQ" rel="nofollow" target="_blank"> Live Demo</a></p><pre class="prettyprint notranslate" style="">using System; public class Demo{ public static void Main(string[] args){ Console.WriteLine("The CAPS LOCK is on or not? "+ Console.CapsLock); } }</pre><h2>Output</h2><p>This will produce the following output −</p><pre class="result notranslate">The CAPS LOCK is on or not? False</pre><h2>Example</h2><p>To check if Num Lock is on or off through Console, the code is as follows −</p><p><a class="demo" href="http://tpcg.io/EySiNPtz" rel="nofollow" target="_blank"> Live Demo</a></p><pre class="prettyprint notranslate" style="">using System; public class Demo{ public static void Main(string[] args){ Console.WriteLine("The Num LOCK is on or not? "+ Console.NumberLock); } }</pre><h2>Output</h2><p>This will produce the following output −</p><pre class="result notranslate">The Num LOCK is on or not? True</pre>
- Related Questions & Answers
- How to Detect if CAPS Lock is ON using JavaScript?
- How to show the status of CAPS Lock Key in tkinter?
- Difference between Object level lock and Class level lock in Java
- Object level lock vs Class level lock in Java?
- Check if Input, Output and Error is redirected on the Console or not in C#
- An alternative invisible lock screen on android
- Transaction lock in MongoDB?
- What is the difference between Monitor and Lock in C#?
- Use ReaderWriter Lock in C#
- How to debug Lock wait timeout exceeded on MySQL?
- How to Lock Your Hard Drive on Windows OS?
- What is the Python Global Interpreter Lock (GIL)
- How to lock screen orientation on all android devices programmatically?
- Lock down of SAP HANA system
- Defining user lock settings in SAP HANA
Advertisements