New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruby FFI freezes when setting up a Windows Hook Procedure #457
Comments
I tried this code on Win 10 with JRuby 1.7.21. Using the ffi that ships with that (don't know the ffi version). I get different behavior. The hook appears to install (good return value, nothing in GetLastError), but then does nothing. No lock up for me, but the puts in the KeyboardProc never appears. everything seems normal. |
Did you try pressing any keyboard keys after calling |
Yes, I did. They went wherever they usually do: various windows on the screen. I was reading more about hook procs, though. I was warned that the app doing the hooking has to run a message pump, or things won't work. Did you run from a command-line app, or a windowed one? I ran mine from a little windowed one. |
@rawhiteside I ran myne from SketchUp application, which already has a message loop - It worked with Win32-API, but froze with FFI. |
Ruby FFI freezes an application when activating Hook Procedure. This issue was originally closed due to the project's closure: #283
I tried this code with the latest FFI commit, but the 'freezing' issue still persists:
Calling
HookProc.hook
works fine, but after pressing any key, i.e triggering the KeyboardProc callback, the application freezes. I tried similar code with Win32-API by Daniel Berger and it worked fine, without freezing an application. I encountered this issue on Windows 7 and Windows 10, Ruby 2.0.0p247 (both win32 and x64). I'm not aware of what's causing the freeze when using Ruby FFI and hope it is resolved.Thanks
The text was updated successfully, but these errors were encountered: