Appendix A. The Windows keycodes

It’s important to know the keycodes if you want to make more sophisticated listeners. If you wanted to distinguish between the left and right versions of the Shift, Control, and Alt keys you would need to be actively checking these keys in each call to your cController::update method. You might write a cControllerLeftRight child class with an overridden update to do this.

This is taken from the file winuser.h. The default set-up for keycodes is that for normal letters and numbers like 0 or Z, you don’t use VK_0 and VK_Z, instead you use the traditional ASCII code symbols ‘0’, ‘Z’, etc.

 /* * Virtual Keys, Standard Set */ #define VK_LBUTTON 0x01 #define VK_RBUTTON 0x02 #define VK_CANCEL 0x03 #define VK_MBUTTON ...

Get Software Engineering and Computer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.