Changeset 6859 for trunk/src


Ignore:
Timestamp:
Sep 28, 2001, 4:08:17 PM (24 years ago)
Author:
phaller
Message:

.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/HOOK.CPP

    r6762 r6859  
    1 /* $Id: HOOK.CPP,v 1.23 2001-09-19 15:39:47 sandervl Exp $ */
     1/* $Id: HOOK.CPP,v 1.24 2001-09-28 14:08:17 phaller Exp $ */
    22
    33/*
     
    805805                             ? TRUE : FALSE);
    806806}
     807
     808
     809
     810/***
     811 * ProcessKbdHookLL
     812 * this is a low-level version of the keyboard hook
     813 * present under NT/2000/XP.
     814 * It is supposed to be called for any keyboard event of the
     815 * system-input queue AFAIK.
     816 */
     817BOOL ProcessKbdHookLL(LPMSG msg, BOOL remove )
     818{
     819  // @@@PH
     820  // format KBDLLHOOKSTRUCT and pass it in as msg->lParam
     821  KBDLLHOOKSTRUCT kbhs;
     822 
     823  // check if alt is currently pressed
     824  BOOL fAltDown = GetKeyState(VK_LMENU);
     825 
     826  kbhs.vkCode      = msg->wParam;
     827  kbhs.scanCode    = ( (msg->lParam & 0x00ff0000) >> 16);
     828  kbhs.flags       = ( (msg->lParam & (1 << 24)) ? LLKHF_EXTENDED : 0 ) |
     829                     // LLKHF_INJECTED currently not supported (SendInput)
     830                     fAltDown ? LLKHF_ALTDOWN : 0 |
     831                     ( (msg->lParam & (1 << 31)) ? LLKHF_UP : 0);
     832  kbhs.time        = msg->time;
     833  kbhs.dwExtraInfo = 0; // @@@PH not supported?
     834 
     835  return (HOOK_CallHooksA(WH_KEYBOARD_LL,
     836                          remove ? HC_ACTION : HC_NOREMOVE,
     837                          msg->message,
     838                          (LPARAM)&kbhs )
     839                          ? TRUE : FALSE);
     840}
Note: See TracChangeset for help on using the changeset viewer.