Changeset 7216 for trunk/src/user32/HOOK.CPP
- Timestamp:
- Oct 26, 2001, 2:46:17 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/HOOK.CPP
r7212 r7216 1 /* $Id: HOOK.CPP,v 1.3 1 2001-10-26 10:03:33phaller Exp $ */1 /* $Id: HOOK.CPP,v 1.32 2001-10-26 12:46:16 phaller Exp $ */ 2 2 3 3 /* … … 45 45 #include <wprocess.h> 46 46 #include "menu.h" 47 #include <winscan.h> 47 48 48 49 #include "win32wbase.h" … … 825 826 826 827 // this undoc (don't care) bit isn't passed through to this hook 827 DWORD lParam = msg->lParam & ~0x02000000; 828 // DWORD lParam = msg->lParam & ~0x02000000; 829 msg->lParam &= ~0x02000000; 828 830 829 831 return (HOOK_CallHooksA( WH_KEYBOARD, remove ? HC_ACTION : HC_NOREMOVE, 830 LOWORD (msg->wParam), lParam )832 LOWORD (msg->wParam), msg->lParam ) 831 833 ? TRUE : FALSE); 832 834 } … … 843 845 BOOL ProcessKbdHookLL(LPMSG msg, BOOL flagRemove, BOOL flagInjected ) 844 846 { 845 // @@@PH846 847 // format KBDLLHOOKSTRUCT and pass it in as msg->lParam 847 848 KBDLLHOOKSTRUCT kbhs; 848 849 850 kbhs.vkCode = msg->wParam; 851 852 // Note: the "extended" bit seems to be filtered 853 kbhs.scanCode = ( (msg->lParam & 0x02ff0000) >> 16); 854 855 BOOL fKeyUp = (msg->message == WM_KEYUP) || 856 (msg->message == WM_SYSKEYUP); 857 849 858 // check if alt is currently pressed 850 859 // Note: ALT seems to stick sometimes 851 // BOOL fAltDown = GetKeyState(VK_LMENU); 852 BOOL fAltDown = GetAsyncKeyState(VK_LMENU); 853 854 kbhs.vkCode = msg->wParam; 855 kbhs.scanCode = ( (msg->lParam & 0x03ff0000) >> 16); 856 857 BOOL fKeyUp = (msg->message == WM_KEYUP) || 858 (msg->message == WM_SYSKEYUP); 860 // Note: ALTGR can't be queried 861 BOOL fAltDown; // = GetAsyncKeyState(VK_LMENU); 862 863 // this bit indicates if ALT was held 864 fAltDown = msg->lParam & 0x20000000; 865 859 866 kbhs.flags = fKeyUp ? LLKHF_UP : 0; 860 867 861 // @@@PH seems not to work properly862 868 kbhs.flags |= fAltDown ? LLKHF_ALTDOWN : 0; 863 869 kbhs.flags |= flagInjected ? LLKHF_INJECTED : 0; 864 870 kbhs.flags |= (msg->lParam & (1 << 24)) ? LLKHF_EXTENDED : 0; 865 866 /*867 kbhs.flags = ( (msg->lParam & (1 << 24)) ? LLKHF_EXTENDED : 0 ) |868 ( flagInjected ? LLKHF_INJECTED : 0) |869 fAltDown ? LLKHF_ALTDOWN : 0 |870 ( (msg->lParam & (1 << 31)) ? LLKHF_UP : 0);871 */872 871 kbhs.time = msg->time; 873 872 kbhs.dwExtraInfo = 0; // @@@PH not supported?
Note:
See TracChangeset
for help on using the changeset viewer.