Posted by dxprog on 03:52:00 01-25-2003
Does anyone know of an API (or a site that explains it) that will do system-wide key trapping? Thanks for anyhelp!
[addsig]
Posted by KaGez on 11:02:00 01-25-2003
what is that "system wide key trapping"? :/
[addsig]
Posted by dxprog on 09:46:00 01-26-2003
Well, the GetKeyboardState or GetKeyState only gets the keyboard state for whatever window handle you provide. I want something that will give me the keyboard status period. Chances are I'll have to do window enumeration and just work from there.
[addsig]
Posted by Neu[Mann] on 01:34:00 01-27-2003
Check for *Journal* procs in the Windows API, or just journaling proc in general. This allows you to install system-wide hooks for many things.
Posted by dxprog on 04:31:00 01-31-2003
I don't quite follow you on the Journal thing. Do mean look in APIViewer or something?
[addsig]
Posted by DarkEvilOne on 07:52:00 02-13-2003
GetAsyncKeyState will get you the state of a key "system wide"
Also these macros might help
#define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
#define KEYUP(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)
examples:
if(KEYDOWN(VK_A))
{
//this will run if the A key is down
}
if(KEYUP(VK_C))
{
//this will run if the C key is up
}
note: you must include the windows.h header file, but you should already know that
Posted by Neu[Mann] on 08:22:00 02-13-2003
HHOOK SetWindowsHookEx(
int idHook, // hook type
HOOKPROC lpfn, // hook procedure
HINSTANCE hMod, // handle to application instance
DWORD dwThreadId // thread identifier
);
Sorry. Journaling was not the right term.
Posted by dxprog on 10:27:00 02-13-2003
I don't have to include anything (I'm using VB). Thanks, is there a SetAsyncKeyState? I guess I'll lok it up. Thanks again
[addsig]
Posted by DarkEvilOne on 17:25:00 02-13-2003
oops, sorry i was thinking i was on the C/C++ messageboard
Posted by dxprog on 23:39:00 02-13-2003
Hey, I didn't really care what language I got it in (except maybe ASM ). That API works like a charm. I used keybd_event to set the key state, by the way.
[addsig]
Posted by themaximus on 02:08:00 07-08-2003
A good site for API is AllAPI.net. Download the API Guide thingamajigger.
_________________
I am a VB Programmer, so get over it!
[ This Message was edited by: themaximus on 2003-07-08 02:10 ]
Posted by minalth on 19:33:00 07-11-2003
what is the windows.h header file?
Posted by Neu[Mann] on 20:46:00 07-11-2003
That's the header file required to make any Windows programing in C or C++.
Posted by minalth on 06:01:00 07-12-2003
how do i put it in?
Posted by Neu[Mann] on 09:29:00 07-12-2003
If you have a recent C compiler, it's already there.
If you are using VB (I think you are isn't it) then you can't use Windows.H directly. You need to use the 'Declare' statement to access Win32 API calls.
It's a bit long to explain and I'm not entirely sure about what you want. If you ask a clearer question on http://www.hprog.org/ or on the #hprog IRC channel, I, or other, will be able to answer your question a bit more easily.
[addsig]