Jump to content

Using keyboard shortcuts for controls


Recommended Posts

Ok, so I know how to set the keyboard shortcut for a control by right clicking and selecting Advanced>>Key navigation. This however doesnt let me do exactly what I want, which is to have a slider, and then have one keyboard shortcut for increasing the value and one keyboard shortcut for decreasing the value.

Will using an event structure that catches key down events on the VI let me do what I want? Is there some pitfall with using this technique that I should be aware of?

Greateful for any replies. I should probably also add that Im using LV7.1 :) .

/Gustva

Link to comment

QUOTE(gustav @ Apr 4 2007, 09:23 AM)

Ok, so I know how to set the keyboard shortcut for a control by right clicking and selecting Advanced>>Key navigation. This however doesnt let me do exactly what I want, which is to have a slider, and then have one keyboard shortcut for increasing the value and one keyboard shortcut for decreasing the value.

Will using an event structure that catches key down events on the VI let me do what I want? Is there some pitfall with using this technique that I should be aware of?

Greateful for any replies. I should probably also add that Im using LV7.1 :) .

/Gustva

All you have to do is tab to the control to give it focus and use the up/down arrow keys.

Link to comment

QUOTE(gustav @ Apr 5 2007, 07:59 AM)

Personally I would be very happy with that solution but unfortunately it is not what the customer requested :) . Thanks anyway.

The 'simple' hackish way to accomplish what you want is to create two offscreen (won't work if hidden) buttons with the keyboard shortcuts you want, and then increase or decrease the value of the slider (using local variables) if one of the buttons is 'pressed'.

You can of course also use the event structure, which would be more elegant. There are no pitfalls in doing this, as far as I am aware :)

-Mikkel

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.