I'm trying to implement keyboard input in C and I don't understand how to capture modified keycodes and get a character from it. Sure, I can create a huge switch statement like this:
// if (shift is pressed) {
switch (vkCode)
{
case 0x30:
log(")");
break;
case 0x31:
log("!");
break;
case 0x32:
//...
This would be ok for one language, but implementing this for different keyboard layouts would be a nightmare.
I found a simple way to convert a virtual key to a character that corresponds to the active keyboard layout:
HKL lang = GetLang();
UINT ck = MapVirtualKeyEx(vKey, MAPVK_VK_TO_CHAR, lang);
printf("%c", ck);
Is there a way to get the modified char in a similar way?
Or how would one go about this?