It should work on Windows, Linux and Mac OS. I've only tested it on Windows.
Make sure to read through that whole thread for details, caveats and cautions. Keylogging and native hooking isn't the abstract idealized world of Java/B4J. You're dealing directly with hardware and operating system events. It can be tricky.
Feel free to report on your successes and failures getting that library to work on any operating system in that thread.
Doing so would probably require greater system privileges than the user.
Another alternative is to package your keylogger into an .exe (check out the B4JPackager tutorial) and give it the same name and description as a system process like conhost or cmd or taskhost (for Windows). There are typically more than one instance of those processes running so an extra one won't necessarily look out of place. You'll want to make sure that you choose a system process with a similar CPU/RAM usage profile as your keylogger so that your keylogger process doesn't look out of place to the astute user. This won't make it forbidden to kill the keylogger but it will hide the keylogger from the user.
Doing so would probably require greater system privileges than the user.
Another alternative is to package your keylogger into an .exe (check out the B4JPackager tutorial) and give it the same name and description as a system process like conhost or cmd or taskhost (for Windows). There are typically more than one instance of those processes running so an extra one won't necessarily look out of place. You'll want to make sure that you choose a system process with a similar CPU/RAM usage profile as your keylogger so that your keylogger process doesn't look out of place to the astute user. This won't make it forbidden to kill the keylogger but it will hide the keylogger from the user.
The alternative strategy I outlined above should be effective on all operating systems. You'll have to package the app separately for each OS and you'll have to choose a different name/description for each OS. But the overall strategy is the same in each OS.