#Consuming global key events on windows
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
advantage of this library to consume global key events on Windows. Is it possible to use jNativeHook to capture key inputs across all windows and applications running on the system, not just within my own Java application?
Unfortunately, jNativeHook is limited in its ability to capture global key events on Windows. It can only intercept events within the Java Virtual Machine (JVM) process that is running your application. This means that it cannot capture key inputs from other applications or windows outside of your Java program.
If you require the ability to capture global key events across all applications and windows on the system, you may need to look into using a different library or tool that provides this functionality. One popular option for capturing global key events on Windows is using the Windows API directly through a language like C++.
Keep in mind that capturing global key events outside of your own application can raise security and privacy concerns, so be sure to consider the implications of implementing this functionality in your software. Additionally, be aware that some operating systems may have restrictions or limitations on capturing global key events for security reasons.
In conclusion, while jNativeHook is a useful library for capturing key inputs within your Java application, it has limitations when it comes to consuming global key events across all windows and applications on Windows.
check windows api doc, see if there is a function which does what you want, and try to call it from java
how would i call windows API functions through java?
Nvm, i'll get on that thanks for the direction 😎
jni or ffm
you should use ffm as it is the newer way to call c from java
you can use jextract to generate ffm bindings for the whole windows api
and then you can just call them
yes
I may have several threads hidden in #1051826284008853505
Creating a window in windows by calling windows c functions from java : https://discord.com/channels/272761734820003841/1133435544064507915
@distant skiff
How to generate bindings with jextract (and also how to change background image on windows from java) : #1072625795375304704 message
@distant skiff
@distant skiff tell me if you have any question
for now i think i need to read up on C so i know what to call in the first place
but this was insightful stuff