Open Horizontal Menu Items Without Mouse Click

Good Morning.

I’m working in Perspective, Gateway 8.0.16.

I have a horizontal menu component with submenus that I use for navigation. Our customer asked if we could replicate their old style of navigation, which was based on keyboard key presses. I can figure out how to capture key presses in the background and navigate as a result.

What I’m unable to do is use a key press to replicate the opening of a menu, as if a user had clicked on one of the menu items with the mouse to open its submenu items. Is it possible to initiate a mouse click event programmatically, or otherwise expand the menu items on the Horizontal Menu without a mouse click?

Thanks.

Might not be the best approach but you can use a robot to give that click, see: Robot (Java Platform SE 7 ) (oracle.com)

Not in Perspective.

Session level key event handlers are something we’re going to add to Perspective; it’s in development at the moment.

That is why I said is not a clever approach haha. Now I’m wondering what might be equivalent to Robot, usable in Perspective.

Great!

Probably nothing as that would be a hackers dream lol.

2 Likes

@PGriffith does this mean that any key pressed (regardless of where focus was when it was pressed) would be captured?

I don’t know, to be honest. At some point, what we can actually intercept is very much up to browsers, so there may even be cross-platform concerns. I think that’s part of the reason the feature is taking a while to develop - we’re trying to iron out as many of these issues as possible before release.

Fair enough. But nothing exists today within Ignition that can capture any key pressed at the view or session level, regardless of component focus?

Correct.

@PGriffith I want to confirm if there is a way to do the following (so far I think the answer is no):

Navigate the horizontal menu by hover over only with a click being required only on the final item you want to get into:

Thanks,

Nick

I don’t know for sure (I’m not involved in the front-end of Perspective, pretty much at all) but my understanding of what’s involved would suggest that you are correct. I think we’d have to implement handling for that at the JS level, and expose it as a prop. Sounds like a feature request/ideas post to me.

Is it been feature requested?

And what is the timeline for that?