kwhat / libuiohook

A multi-platform C library to provide global keyboard and mouse hooks from userland.
Other
489 stars 123 forks source link

using libuiohook with other libraries that take keyboard input #33

Open lilmike opened 8 years ago

lilmike commented 8 years ago

Hi, I am using allegro to get keyboard input, and really all I wanted was to get a keyboard hook on all platforms (as I am making mainly audiogames, aimed at the blind, and some screen readers, namely jaws for windows, hog the keyboard unless turned off, or an application specific hook set to override its hook). However, when I run my program with libuiohook installed, I get a bunch of log messages (btw, how to make those go away?), and allegro doesn't get any keyboard input. Any way to make allegro play nice with libuiohook? Thanks, -Michael.

lilmike commented 8 years ago

Oh and my code can be found here: https://github.com/2mb-solutions/bash-it -Michael.

kwhat commented 8 years ago

You can control the logging by calling the the hook_set_logger_proc() method with a custom callback. Just match the signature bool uiohook_logger_callback(unsigned int level, const char *format, ...); I am not sure how to answer your entire question because I don't know enough about allegro. You would need to dig though the allegro source to see how they are getting keyboard input. All input sent by this library should be detectable by SetWindowsHookEx on Windows. I am assuming you are having this problem on Windows?

lilmike commented 8 years ago

I am having this problem on windows, though I haven't tried on mac or linux yet. I will ask on the allegro forums and get back with you. -Michael.

On 12/17/2015 10:27 AM, Alex Barker wrote:

You can control the logging by calling the the hook_set_logger_proc() method with a custom callback. Just match the signature |bool uiohook_logger_callback(unsigned int level, const char *format, ...);| I am not sure how to answer your entire question because I don't know enough about allegro. You would need to dig though the allegro source to see how they are getting keyboard input. All input sent by this library should be detectable by |SetWindowsHookEx| on Windows. I am assuming you are having this problem on Windows?

— Reply to this email directly or view it on GitHub https://github.com/kwhat/libuiohook/issues/33#issuecomment-165501027.

kwhat commented 8 years ago

I wonder if they are using WINAPI OpenDesktop. See: https://github.com/kwhat/jnativehook/issues/86