Virtual Keys :: MFC
Hi.
I would like to know how to determine when the user presses, say, ''z'' *while* holding down one of the virtual keys, say Ctrl.
For example
// Ctrl + Z
I can use either OnKeyDown(...) and/or OnChar(...) to determine *either* Ctrl or z, but not both.
I am trying to implement an "undo" feature.
Thanks,
Kuphryn
I think you need to keep track of the state of ctrl.
There''s also a OnKeyUp - set a flag when ctrl goes down, unset it when ctrl goes up.
There''s also a OnKeyUp - set a flag when ctrl goes down, unset it when ctrl goes up.
My personal solution would be to use GetAsyncKeyState with VK_CONTROL while you process the VK_Z to determine whether or not Ctrl (or shift or anything else for that matter) is being pressed simultaneously.
-fel
-fel
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement