Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Jul : Re: (Keyboard event origin) Is any key phisically pressed?
| Subject: | Re: (Keyboard event origin) Is any key phisically pressed? |
| Posted by: | "Kürşat" (kursattheki..@hotmail.com) |
| Date: | Tue, 25 Jul 2006 16:57:18 |
Thanks,
I will try and write results here.
"Jim Rowell" <x@y.com> wrote in message
news:44c240aa$1@newsgroups.borland.com...
> Kürşat wrote:
>> Hi,
>>
>> Is it possible to know whether a keyboard message is generated by a
>> phisical key press or an application. If possible, how?
>
> You could use an LL keyboard hook. The LowLevelKeyboardProc function
> returns
> a pointer to a KBDLLHookStruct structure that includes flags for various
> things. One of those is the event-injected flag. I've never tested that
> flag
> but I believe it tells you whether or not a real key was pressed or a fake
> keypress was injected by an application.
>
> Mind you, if an application manipulates things at a low enough level, that
> structure could falsely indicate a true key.
>
> --
> Jim Rowell