• Advertisement
Sign in to follow this  

getting keystates when not in focus

This topic is 3874 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to make a small app to make keyboard macros. I am using sdl to get the keyboard state with SDL_GetKeyState. The problem is this doesn't seem to work when the app does not have focus. I don't want it to take focus over other windows. I just want it to respond to keyboard events that are sent to any window. So if you would give me an idea or send me to a page to read I would appreciate it. thanks.

Share this post


Link to post
Share on other sites
Advertisement
Google is very helpful.

Note that it's possible to hack other APIs to do the same, but that's not kosher.

Hooking global events is also not applicable to your application, but tends to be main focus of various keyloggers or other malware, so you can run into problems with virus/malware scanners.

Share this post


Link to post
Share on other sites
thanks antheus. I did plenty of searching but I didnt know of the term hooking. I should be able to find what I need now. I've been using sdl with c++ but it seems that sdl probably isnt capable of what I need. Am I limited to using the win32 api?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement