Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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.

I don't know if this is truly MONO, but in .Net controls you have the IsKeyLocked method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top