B4J Question Trap Mouse button event (outside pane)

ThRuST

Well-Known Member
Licensed User
Longtime User
How to trap clicking of a mouse button in B4J, note: Outside the pane, which means in empty desktop area. I want to add contextmenu to mouse button #2, or even better support Logitech G gaming mouse devices with 9 buttons.
 

ThRuST

Well-Known Member
Licensed User
Longtime User
I got the idea for mouse button support in applications by seeing the mouse device from Logitech on YouTube Here
It would be nice to be able to catch any of the mouse buttons. I have not seen a mouse library for B4J but hopefully it's possible.
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
Thanks, however the example is only covering keyboard, so maybe someone can provide an example how to trap the mouse button using this library.
A little code example by the author of the library, if that person sees this post please leave a comment.
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
Thanks I will look at that. Anyone have clues how to access mouse buttons directly from code outside the form? It would be great because I need customized mouse button functionallity to support Logitech G300S mouse device with 9 buttons. Something like a B4jMouse library.
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
I had a quick look at the SDK for the G300S - that will supply the extra 4 button input (the first 5 are standard mouse buttons), but only if the application is running in the foreground. They supply a DLL, so you would be stuck using windows, and need to use JNI (probably) to access the functions.
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
Daestrum, I was not aware of that Logitech mouse is stuck using windows. That's good to know, even though it would be useful to trap only the right or middle mouse button, which would support most devices that allready is around. There's so many obstacles when developing for Java in B4J, but I keep struggle on because I want my new project to be cross-platform so I guess that means I have to focus on the very basics, or go back to Visual studio and WPF, but somehow I see that as a failure.
But to be honest, if I rewrite my project for Windows I can add all my visions with ease, but again, then I will not support Mac, Linux and perhaps Solaris users.
My post tend to be more of a blog than of answer to my questions, but the current lack of support for B4J vs Microsoft the giant is impossible to ignore.
Ok these days computers are faster than ever so we can run Mac/PC-PC/Mac but ever since I discovered B4J I simply can't let it go. I face a dilemma I wanted to share.
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
Great news, I have now bought the Logitech G300S mouse and it's the very best mouse device I have ever bought :)
Logitech provides drivers for both Windows and OSX (all versions) so there's no problem at all to add support for it for any project, which is awesome.
You can easily program any of the 9 buttons and assign them to keyboard shortcuts, single or combinations, which opens up for new ways to write applications.
I have decided to stay with B4J and develope my Mindcraft project entirely as a cross-platform program. After a whole days testing I can as a long time
experienced programmer warmly recommend this device from Logitech to everyone really. The leds on each side can be customized as well and leaves a
nice glow in the dark as you code, which is really nice. I kindly ask for help how to trap the mouse buttons outside a form in B4j in simple ways, also example
code is warmly welcome for myself and everyone who decides to buy a gaming mouse. Of course there's other good brands as well, but from the Logitech mouses
I have tested the G300S is my primary choice. And since I will support it in my knowledge management application (which is perfect for code snippets) you will
not only be able to organize everything you learn, but also access stuff easily with a professional gaming mouse. This is possible in year 2017 thanks to Anywhere software, Logitech and Duologic software, and all you great programmers in this amazing community. I will release a beta version once I get more functionality
inbuildt, and mouse support is just one of many vital functions that makes programming more efficent.

Logitech G300S.jpg


The gaming mouse Logitech G300S will be supported in Mindcraft knowledge manager. Equal or better versions works good as well.
I cannot guarantee other mouse devices will work, but as long as some of the buttons can be programmed in a freestanding application it will work.
 
Upvote 0
Top