Alright so, I'm trying to create a hotkey function on a CLR form. I don't know where to declare the hotkey so they're available at any given time while the forms open, so I added them to a timer. My problem being is that by sending a key [hotkey] it does an infinite loop. Of course it's because it's on a timer, but I else'd the statement. This is what I have, Hotkey being a timer
It checks and unchecks, the only fix I could come up with is having a timer for each function, if I just have one other timer and disable the Hotkey timer after a hotkey is sent, then I won't be able to use the hotkeys on anything else. Any suggestions?
Under C++, this looks like an attempt to carry out the XOR operation on the (static?) variable System::Object and the variable sender, but embedded in the parameter definition of a function for some crazy reason. Is that what you meant? Or is this actually some kind of CLR and/or .NET language, and not C++?
It's microsoft's frankenstein of C++, it is not standardized. Like almost all things microsoft does, it tries pushing through doing it's own thing while the rest of the world follows the standard. Should just use .Net where it was originally intended to be, in C#.
I can't really help you if your syntax is wrong, but CLR still uses the same API and I can tell you that you're better off using GetAsyncKeyState(): http://msdn.microsoft.com/en-us/library/windows/desktop/ms646293(v=vs.85).aspx this will tell you if the key was pressed since it was last evaluated, instead of if it is being pressed at that particular split second that the program checks it with GetKeyState().
Also the way you have it written here it looks like you're toggling the 'Checked' value every time the key is pressed. Is that what you intended to do?