Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

MouseListener for all actions?

Basically I want to make a quick program personally that uses hotkeys, so if I click mouse_3 I want it to type something specific. I don't want it to be bounded to any particular jframe I want it to work if I was making a post like on here.

Any direction would be appreciated, from what I know about mouselisteners is that they're usually binded to a JFrame of some sorts.
Web Developer
I don't think keyboard hooks are natively supported in the JVM.

https://en.wikipedia.org/wiki/Java_Native_Interface
https://msdn.microsoft.com/en-us/library...s.85).aspx

Code
WH_KEYBOARD_LL
Use a different language. AutoIt comes to mind
[Image: TEGE4Zx.png]

Puzzle level: 2/5
(Sep 9, 2017 04:21 AM)nOrr Wrote:  Use a different language. AutoIt comes to mind

This.
Or if you're keen on using Java, another alternative is using JNI/JNA and learn to write some C code :P
If you want to hook all input events without doing some sort of overlay or having the events register thru your program you're gonna need to use JNA
https://github.com/java-native-access/jna

You're much better off doing it in another language tho
It's just gonna be a bitch to work with native stuff in java like that
(Sep 9, 2017 05:30 PM)matt Wrote:  This.
Or if you're keen on using Java, another alternative is using JNI/JNA and learn to write some C code :P

Why on earth would you want to even touch Java if you need C? >_>
[Image: TEGE4Zx.png]

Puzzle level: 2/5


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by Hi I'm ArnoldJan 8, 2022 10:36 AM 1 117 Jan 8, 2022 10:36 AM
Last Post: Lookdadon
[C#] by NinjaJan 30, 2018 02:44 PM 6 412 Jan 30, 2018 02:44 PM
Last Post: Ninja
[Python] by GameFreakMay 7, 2017 09:05 PM 5 354 May 7, 2017 09:05 PM
Last Post: Pylon