thebeardedquack
thebeardedquack
CC#
Created by infernus8349 on 3/6/2023 in #help
❔ Keyboard hook
Just download AutoHotkey, I'm sure there's a few-liner that'll key-log 😄
22 replies
CC#
Created by infernus8349 on 3/6/2023 in #help
❔ Keyboard hook
Not many things do
22 replies
CC#
Created by infernus8349 on 3/6/2023 in #help
❔ Keyboard hook
I've not looked into RawInput as Jesteeee suggested
22 replies
CC#
Created by infernus8349 on 3/6/2023 in #help
❔ 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
CC#
Created by Kosta on 3/7/2023 in #help
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
That looks nasty XD
242 replies
CC#
Created by Kosta on 3/7/2023 in #help
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
I assume that's something handled by your toolkit
242 replies
CC#
Created by Kosta on 3/7/2023 in #help
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
What property?
242 replies
CC#
Created by Kosta on 3/7/2023 in #help
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
buttonOne exists
242 replies
CC#
Created by Kosta on 3/7/2023 in #help
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
ButtonOne is not a property that exists from what I can see on CalculatorVM.cs
242 replies
CC#
Created by Kosta on 3/7/2023 in #help
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
I'm not familiar with your particular MVVM toolkit... Most of what I've seen uses properties, not fields, and doesn't require attribute decorations
242 replies
CC#
Created by Kosta on 3/7/2023 in #help
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
MVVM usually has some reflection under the hood that gets the class name and replaces "ViewModel" with "View"
242 replies
CC#
Created by Kosta on 3/7/2023 in #help
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
If you're learning, keep it super simple for yourself. Have a MainWindowView.xaml and a MainWindowViewModel.cs
242 replies
CC#
Created by Kosta on 3/7/2023 in #help
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
How does your MVVM framework know that it should connect "MainWindow" which is not named "View" with "CalculatorVM" which is also not named with "ViewModel"?
242 replies
CC#
Created by Kosta on 3/7/2023 in #help
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
I just looked at your project repo... Where's your views?
242 replies
CC#
Created by Kosta on 3/7/2023 in #help
❔ 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
CC#
Created by Kosta on 3/7/2023 in #help
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
This is MVVM, so you should have a MainWindowView and a MainWindowViewModel
242 replies
CC#
Created by Kosta on 3/7/2023 in #help
❔ 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
CC#
Created by Kosta on 3/7/2023 in #help
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
Ew
242 replies
CC#
Created by Kosta on 3/7/2023 in #help
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
InitializeComponent() will cause UI updates. UI items pull information from the DataContext DataContext does not exist during InitializeComponent()
242 replies