Tool Tip visibility key? Like Alt in old school VB apps?

Use this board to ask questions or have discussions with other Genie users.
Post Reply
Larelyn
Profound User
Posts: 30
Joined: Thu Mar 20, 2014 2:31 pm
First Name: Lisa
Last Name: Lawrence
Company Name: The Scoular Company
Contact:

Tool Tip visibility key? Like Alt in old school VB apps?

Post by Larelyn »

I have a challenge with two different camps in my company - the heads-down-data-users and managers who want to modernize. The managers think displaying function keys F# is outdated and ages the app (the function text is fine, just leave off the F# part). The users want to see the F# function key on the screen to keep their hands on the keyboard and continue on their task with no interruption.

For now, function key text appears as a hyperlink with the function key F# in a hovering tool tip. But, this still isn't good enough for the users - it requires the mouse to hover.

Would anyone have any suggestions how I can create a javascript function that will take a keystroke (ctrl, alt, or something like that) and display ALL the tool tips?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Tool Tip visibility key? Like Alt in old school VB apps?

Post by Scott Klement »

Most customers allow both the F-keys and button/link clicks in their displays. This way both types of users can do it their way. This is the first time I've heard a complaint that text on the screen describing the keys is a problem for management. Usually they are happy with it as long as there's a GUI alternative.

If you wanted to, for example, pop up information when the user hits some sort of key, you could certainly do that. There's nothing built-in to the product for this, but there's no reason you couldn't code it.

The pseudo-code would look something like this:

1. Attach JavaScript code to the keyboard's "keydown" and "keyup" events.

2. In the JS code, check for the key... if it is the one you choose (alt?) and the key is pressed down, display a widget (or custom html?) that shows what the keys are. For the key up event for the same key, hide that key text.

3. To determine the key text, loop through all of the output fields (or hyperlinks?) on the display, and check their tool tip properties. You could do this each time a screen loads to build the help display.


We provide some tools that might be helpful. For example, in 5250 mode, the "afterLoad" function runs after every screen has been loaded. You could use code run from this event to build your help display, and to attach the keyboard events. That way, you only need do it once for all screens.
http://www.profoundlogic.com/docs/pages ... Id=5275903

In a Rich Displays (including those run from within Genie or Atrium) you can use the pui.onload event for the same purpose:
http://www.profoundlogic.com/docs/displ ... pui.onload

To attach events to the screen (so that you don't have to code them on a per-widget basis) you can use the addEvent API described here:
http://www.profoundlogic.com/docs/pages ... Id=3276841

To get all of the output fields on the display, you could use the getOutputFields() API, if desired:
http://www.profoundlogic.com/docs/pages ... Id=4850002

Though, instead of getOutputFields() you could also use the browser's built-in routines like getElementsByTagName, getElementsByClassName, querySelectorAll etc. These might work better if you only want to retrieve hyperlinks.

Any of the elements returned by the above APIs should have pui.properties["tool tip"] defined on them if they are widgets that contain tool tips. You can read that to get the tool tip values.

Hope that helps you get going...
Larelyn
Profound User
Posts: 30
Joined: Thu Mar 20, 2014 2:31 pm
First Name: Lisa
Last Name: Lawrence
Company Name: The Scoular Company
Contact:

Re: Tool Tip visibility key? Like Alt in old school VB apps?

Post by Larelyn »

Thanks, Scott! It certainly is enough to get me moving in the right direction!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest