0

I know it is possible to suppress inputs(including keystrokes) in languages such as c++, c#, and visual basic. As well as through programs such as luamacros and Auto Hotkey. Is there a way to do this in java? If so, how? Is there a library or would I have to write my own?

Edit: To clarify I need this to be native such that it is possible to for instance disable the 8 key in any program.

Devon Rutledge
  • 143
  • 1
  • 11
  • 1
    Swing? JavaFX? Something else? – Andreas Feb 19 '18 at 04:37
  • For my purposes it needs to be native. I have updated the question to reflect this. – Devon Rutledge Feb 19 '18 at 04:40
  • 1
    Java doesn't do native. The entire point of Java is to run at an abstraction level above native, so it can run on all platforms, and the JVM handles the differences in native. Answer: No, Java cannot do that. – Andreas Feb 19 '18 at 04:51
  • Is it possible to have a library that does it? Libraries such as JInput allow for raw input and JNativeHook allows for native. – Devon Rutledge Feb 19 '18 at 04:55
  • Does any of this help: https://stackoverflow.com/questions/8138411/masking-password-input-from-the-console-java , https://stackoverflow.com/questions/4005574/java-key-listener-in-commandline ? Note there are multiple responses and links to other questions. – tkruse Feb 19 '18 at 05:13
  • Not really, As I say in the question I need to be able to suppress keystrokes within any program, not only in command line. Meaning that I can prevent keyboard input to any program. This link [link](https://msdn.microsoft.com/en-us/library/system.windows.forms.keyeventargs.suppresskeypress(v=vs.110).aspx), shows how it is done in other languages but I need to be able to do it in java. – Devon Rutledge Feb 19 '18 at 19:10

0 Answers0