gustav Posted April 5, 2007 Report Share Posted April 5, 2007 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 Quote Link to comment
jhoskins Posted April 5, 2007 Report Share Posted April 5, 2007 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. Quote Link to comment
gustav Posted April 6, 2007 Author Report Share Posted April 6, 2007 QUOTE(jhoskins @ Apr 4 2007, 06:38 PM) All you have to do is tab to the control to give it focus and use the up/down arrow keys. Personally I would be very happy with that solution but unfortunately it is not what the customer requested . Thanks anyway. Quote Link to comment
Mikkel Posted April 6, 2007 Report Share Posted April 6, 2007 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 Quote Link to comment
James N Posted April 6, 2007 Report Share Posted April 6, 2007 I don't think there's any performance pitfalls with using the key down event. Just be sure to handle what you really want to handle inside the event. http://forums.lavag.org/index.php?act=attach&type=post&id=5411 -James Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.