thebeardedquack
❔ Keyboard hook
GetAsyncKeyState()
is still probably not the correct solution, you suggested you needed something like a key logger. While this function will return the current keypress states, it doesn't provide you with which order the keys are pressed in, and you're required to poll, which means likely missing events, or wasting a bunch of CPU in a tight loop.
There is SetWindowsHookEx()
where you can tell Windows which events you're interested in. One of the values is WM_KEYBOARD
, which requires a KeyboardProc
callback. This is probably the most "correct" solution, based on what you've described.
Unfortunately I can't tell you whether this solution requires a main event loop or not as I've never used it myself (I have used GetAsyncKeyState()
before). If you do need an event loop, the easiest way for me would probably just do this all in C++ and use WinMain and register an empty, hidden, window object.22 replies
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
The MainWindowViewModel is the DataContext for a MainWindowView.
Your MVVM framework should be able to automatically select the View, when you tell it to display a ViewModel
242 replies
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
As far as I'm concerned the View should have no code whatsoever.
The ViewModel should have no idea about UI, whatsoever.
Everything, is done via binding. The data context for your View, is the ViewModel, and the two are connected via binding
242 replies