I'd like to retrieve the state of the Ctrl
keys in a place where I don't have a form.
Normally to get a key state I'd use Control_KeyDown / KeyUp events. However, the code that needs to know whether Ctrl is pressed is outside any form. There is a form displayed, but the code is supposed not to depend on that form but finding the key state on its own.
Surely there is a way to do that, only I don't succeed to find it on google.
Note that although the code doesn't "have" a form available, its still a WinForms application, so maybe the framework provides some class/object for me to achieve that goal.
Background:
During the application startup phase, I want one step to behave differntly if the Ctrl key is being pressed in that moment. The startup phase displays a splash screen, but the code for the startup isn't aware of that. Instead it reports progress to a callback, and that callback updates the splash screen.
If I use the splash screen for fetching the KeyDown event, I make the startup code depend on that splash screen, which introduces a circular dependency. I want to keep the freedom to remove the splash screen and replace by something different.