keybd_event problem?

Here's my code:
1
2
3
4
5
6
7
8
9
10
11
__inline VOID SendText(__in_z LPCSTR lpcsz, __in_opt DWORD dwDelay = 10)
{
	for(UINT i = 0; i < strlen(lpcsz); i++, Sleep(dwDelay))
	{
		if(isupper(lpcsz[i]))
			keybd_event(VK_SHIFT, 0, 0, 0);
		keybd_event(VkKeyScan(toupper(lpcsz[i])), 0, 0, 0);
		if(isupper(lpcsz[i]))
			keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP, 0);
	}
}


But when I try to send the string "lol?" it sends "lol/". How can I detect if the key is a key that needs to be "SHIFT-key"'ed? (i.e. '?' and '/' are on the same key, '/' is default, but if you press the SHIFT key '?' is sent)
Last edited on
Topic archived. No new replies allowed.