views:

224

answers:

2

Is thyere a way in Mono.Net to get and set the Num/Caps/Scroll-lock status platform independent (Linux and Windows)?

Thanks in advance.

+1  A: 

Use the pinvoke signature for GetKeyState under Windows, the MSDN about GetKeyState is here. As for mono, I am not sure.

There is no such thing as a cross-platform API if p/invoke is used as Mono under Linux does not have a Win32 API equivalent, remember the whole exercise in relation to Win32 API's is that they are specifically for the Windows system, in which Linux does not have!

To be truly platform independant with .NET and Mono under Linux requires that no specific Win32 API's and p/Invokes are used.

Hope this helps, Best regards, Tom.

tommieb75
+1  A: 

The .NET Console.CapsLock and NumberLock properties return the key state. Mono has them too, but they are not yet documented. Give it a try.

Hans Passant