Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include "util.h"
- LRESULT CALLBACK NewKeyboard(int code, WPARAM wParam, LPARAM lParam)
- {
- KBDLLHOOKSTRUCT *lol = (KBDLLHOOKSTRUCT*)lParam;
- if(code < 0)
- CallNextHookEx(hhk, code, wParam, lParam);
- if (wParam == WM_KEYDOWN)
- if (vkcodetounicode(lParam))
- return 1;
- return 0;
- }
- DWORD vkcodetounicode(LPARAM lParam)
- {
- KBDLLHOOKSTRUCT *lol = (KBDLLHOOKSTRUCT*)lParam;
- INPUT test;
- ZeroMemory(&test, sizeof(test));
- test.type = INPUT_KEYBOARD;
- test.ki.dwFlags = KEYEVENTF_UNICODE;
- for (int i = 0; i < 26; i++)
- {
- if (lol->vkCode == 0x41 + i)
- {
- test.ki.wScan = 0xFF41 + i;
- SendInput(1, &test, sizeof(test));
- return 1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment