[Mono-list] Console.CapsLock / Console.NumberLock replacement?

fewt awyatt at gmail.com
Fri Jul 16 12:53:10 EDT 2010

Hi, hopefully I am posting this in the right section.

I am trying to capture the state of the CapsLock and NumberLock keys,
however this operation doesn't seem to be supported.

Unhandled Exception: System.NotSupportedException: Operation is not
  at System.TermInfoDriver.get_NumberLock () [0x00000] in <filename
  at System.ConsoleDriver.get_NumberLock () [0x00000] in <filename
  at System.Console.get_NumberLock () [0x00000] in <filename unknown>:0 
  at Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 

I have been googling for a while but my searches are turning up empty.  Is
there another way to determine the state of these keys using Mono?

I am using gmcs to build, and I don't get any compiler warnings.

Here is the source:

using System;
class Program {
  static void Main(string[] args) {
    if ( Console.CapsLock ) {
      Console.WriteLine("CapsLock on..");

Thanks in advance for any guidance!
View this message in context: http://mono.1490590.n4.nabble.com/Console-CapsLock-Console-NumberLock-replacement-tp2291661p2291661.html
Sent from the Mono - General mailing list archive at Nabble.com.

More information about the Mono-list mailing list