LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

'switch until released' problem

I have a 'switch until released' item on my panel.  If it is clicked on with the mouse, all is well.
 
However, my user is using a keyboard to fill in numbers, and Tabs from one to the next filling them in.  He then Tabs to the 'switch until released' and presses Enter.  Problem - it latches.
 
I have coded round this, but it does the same in LabView 7.1 and 8.5.
0 Kudos
Message 1 of 11
(4,463 Views)
Can you make latch when released?
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 2 of 11
(4,462 Views)
Now here is the right answer.Smiley Wink
 
Go to the properties for the switch, Key Navigation Tab.
Check skip this control when tabbing.
 


Message Edited by Ravens Fan on 04-09-2008 10:40 PM
Message 3 of 11
(4,434 Views)

I think the behaviour Clare wants is:

Tab to the control, press the enter key and it switches to "On". Release the Enter key and it switches back to "Off".

What happens is that each keyboard event changes the state. The keyboard repetition of "key down" will switch the control from "On" to "Off" and vice versa.

The skip control when tabbing forces the user to put the hands from the keyboard and use the mouse.

Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 4 of 11
(4,420 Views)


waldemar.hersacher wrote:

I think the behaviour Clare wants is:

Tab to the control, press the enter key and it switches to "On". Release the Enter key and it switches back to "Off".

What happens is that each keyboard event changes the state. The keyboard repetition of "key down" will switch the control from "On" to "Off" and vice versa.

The skip control when tabbing forces the user to put the hands from the keyboard and use the mouse.




No. Smiley Happy
 
He stated that it was behaving so, while it should actually behave like it must turn on [True state] just for that moment when the Enter key is pressed & immediately turn off [revert back to False].
 
Did you run the VI & see the bahaviour of the button in both the Mouse & the Keyboard modes?
If you do, you ll easily get to know what he says.
- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 5 of 11
(4,407 Views)


waldemar.hersacher wrote:

I think the behaviour Clare wants is:

Tab to the control, press the enter key and it switches to "On". Release the Enter key and it switches back to "Off".

What happens is that each keyboard event changes the state. The keyboard repetition of "key down" will switch the control from "On" to "Off" and vice versa.

The skip control when tabbing forces the user to put the hands from the keyboard and use the mouse.




No. Smiley Happy
 
He stated that it was behaving so, while it should actually behave like it must turn on [True state] just for that moment when the Enter key is pressed & immediately turn off [revert back to False].
 
Did you run the VI & see the bahaviour of the button in both the Mouse & the Keyboard modes?
If you do, you ll easily get to know what he says.
- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 6 of 11
(4,406 Views)
Sorry for posting twice due to low speed. Smiley Sad
- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 7 of 11
(4,403 Views)

Using the mouse you see: Mouse Down -> On, Mouse up -> Off Holding the mouse dowm for lets say ten seconds, the user does mouse down, holding, mouse up.

Using the keyboard you see: Key down -> On, Delay, Key down -> off, Key down -> on, Key down -> off ... Pressing the key for lets say ten seconds, the user does key down, holding, key up.

Yes you must use an event structure with an filter event on Keydown.

Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 8 of 11
(4,375 Views)

Your answer is very descriptive n clear; but see the attached VI. Smiley Happy

Filterig Key Down? event seems ti have no effect on the OK button. Smiley Sad

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 9 of 11
(4,370 Views)
Hi Partha,

I have been investigating whether this is a bug and have come to the conlusion that it is not a bug, however, it is not the most straightforward behaviour. The problem is that there is a distinct difference between the operation of a keyboard and mouse in the way it is interpretted by the PC. this means that it is difficult to replicate the mouse behaviouir using the keyboard as some of the other guys were indicating. To get round this you can use events as you were looking at, and replicate the  switch until released behaviour by modifying the value of the control on a key up event. This then gives the impression of the switch untul released behaviour. The problem with this that I believe you identified is that the release of the key when pressing tab causes a key up event to generate. This is just the way that the tab button works and is unavoidable, but you can get round it in the key up event by checkin if it's the tab button which has been pressed by getting the source parameter. If it's the tab button, you simply don't modify the value of the control.

I've included a Vi which demonstrates this, I hope it clears things up.

Best wishes
Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
0 Kudos
Message 10 of 11
(4,186 Views)