B4J Tutorial Floating ContextMenu using jNativeHookB4j

stevel05

Expert
Licensed User
Longtime User
(that replaces the one showing)

I'm not sure what you mean by this. If you click a button on the window, the context menu will close.
 

ThRuST

Well-Known Member
Licensed User
Longtime User
I mean if you add more buttons in the form that enables the menu, the first one shows a single contextmenu options, but if you add another button to the form, FM3 then the contextmenu with a main menu options including with a submenu can be accessible, which allows to choose which menu to use and when. My new CSS templates will crush all competition. We're unbeatable together
 

stevel05

Expert
Licensed User
Longtime User
Demo Changed V0.8
 

stevel05

Expert
Licensed User
Longtime User
Do you mean edit an existing menu? It would be simpler just to have a duplicate with the additional options added.
 

ThRuST

Well-Known Member
Licensed User
Longtime User
I guess there's no need for submenus because of all the buttons on the mouse. You're right, it will also be easier to use it this way. The new design is really nice. There's just much tweaking to get it right. I'm editing the script while the code runs, in case you didn't know this. The first five buttons can be called from int 1-5 while the rest of the buttons (6-9) used keyboard combinations. These can easily be set in the tray application provided by in this case Logitech, which means jAWTRobot must be used to made such calls. I assume you read about it yesterday so you know how it works. I dunno which keyboard combinations is appropriate to use. Those should be available and not be in conflict with any other software. They should also work on both Windows and Mac. You should perhaps buy the mouse to get familiar with it. This is the Swedish version so you'll not be able to read it, but it's easy to get an idea how it's used. The changes is stored inside the mouse

 

ThRuST

Well-Known Member
Licensed User
Longtime User
btw there's drivers for both PC and Mac for these kinds of gaming mouses, and Logitech also provides SDKs to set the led color and stuff. This could be a cool feature to change led color in the mouse depending on which menu is showing, but that's not really important in this case.
 

ThRuST

Well-Known Member
Licensed User
Longtime User
Code allways changes. You just have to make it work before each update
 

stevel05

Expert
Licensed User
Longtime User
You should also implement keyboard shortcut alternatives for all options for people that don't have one of these mice. Perhaps try using Ctrl+Alt+NumPad key as default as there are 9 of them.
 

ThRuST

Well-Known Member
Licensed User
Longtime User
I forgot this, about the logitech tray application. Any combination can be programmed in one, two or up to three combinations. So if using a 3 way combination it should not conflict with any other software. At least the chance are lower that to does. if this can be assigned to the AWTRobot then that will be awesome
 

ThRuST

Well-Known Member
Licensed User
Longtime User
That is a great idea. Funny, I was thinking that you was to inbed the code for AWTRobot. But then I realize that that's my wrk. Or if you add it that'll be great
 

ThRuST

Well-Known Member
Licensed User
Longtime User
I just noticed that left and right buttons cannot be assigned to a keyboard shortcut in Logitechs application. They can only be shifted with eachother. The middle mousebutton (mousewheel) and the rest can be assigned a keyboard shortcut. I think this won't inflict any problems when it's possible to access all menus through button shortcuts. Besides users can use their own mice. I said Mouse and you mice!! Maybe I was refering to that of a rat, but I guess you understood anyway
 

ThRuST

Well-Known Member
Licensed User
Longtime User
Steve, I just tested you update to v08 and it's really nice. Now it's starting to look really useful. This makes me impressed how well you implement the functionality based on our conversation. Your code together with my CSS creates a perfect balance. This is a good example how efficient it is to work as a team. Much much powerful than single development efforts, that usually ends up in nowhere.
 

stevel05

Expert
Licensed User
Longtime User
I think most people will have a 2 button mouse with scroll wheel, not sure about Mac or laptops though. I think most touchpads on Laptops can emulate a scrollwheel these days. Should be OK.

Mouse, mice? just plural, not sure if it should apply to hardware but it sounds right.
 

ThRuST

Well-Known Member
Licensed User
Longtime User
I think the markers subitems looked better without the box!!! why add that? it looks better without it because the box is too close to the menuitem text, but if you add a space to it it's better. READ MY LIPS
 

ThRuST

Well-Known Member
Licensed User
Longtime User
Steve, Good news.. It works PERFECTLY on my MacBook. The contextmenu looks like I'm running it on Windows even though it's OSX El Capitan. Awesome
 

stevel05

Expert
Licensed User
Longtime User
So do you have to make an Aqua theme as well?
 

ThRuST

Well-Known Member
Licensed User
Longtime User
You want a transparent CSS theme? I have not yet looked that up but I assume it could be done. Nice idea I'll look it up.
 

stevel05

Expert
Licensed User
Longtime User
A thought Aqua was the Mac lookalike theme.
 

ThRuST

Well-Known Member
Licensed User
Longtime User
Not sure what you mean, but the contextmenu used the CSS that comes with the code. It is not affected by the menu design used in OSX El Capitan.
Possibly this can be changed, but I'm not sure how. I am working on a new layout, similar to the dark theme I posted earlier. But this will be compatible with v08.
After that you updated your code there's no problem to create complex CSS themes. In fact it works flawlessly. I recommend that you use the theme I will post since it works very well. I will perhaps comment each line to make it easier to locate what each block does. I dunno about you, but I'm not an CSS expert.
I just keep changing stuff untill it works, that's why it's a rather time consuming task. But once it works it's worth every effort (and time too)
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…