08-03-2017 11:28 PM - edited 08-03-2017 11:29 PM
Now that you know the reason, you can figure out how to work around it.
One possibility. detect if the "new" value is the same as the "old" value. You can store the value in a shift register so you know what it was. If it is, then you know it didn't change. Execute a case structure after the event structure that will check the local variable again and execute it.
Actually, don't do anything in the event case. Just wire out a True to a case structure after it so that it executes what you current have in the event case. That will allow the mouse down event to finish the update of the control. There is a small wait in there to allow the CPU time to finish the updating of the control before it is read.
08-04-2017 09:26 AM
@JiaLiGenmark wrote:
Dear,
Thank you for your explanation. It's very detail.
Yes, Mouse down is necessary. The reason I do not use mouse up is because of concerning of customer experience. That's the major reason I make post today. There's always delay of firing if we do mouse up.
Best,
Every operating system I know of uses mouse UP for a button click. Because the event won't fire until mouse UP, you have a chance to move off of the control before finishing the click. This cancels the command. May I enquire as to why the user needs this "instantaneous" input?
08-04-2017 09:50 AM
Here is my mod.
1. Changed the boolean to a control and set it to Latch When Pressed. This way, the value will change when the mouse is pressed down on the control.
2. Changed to event to be Value Changed and moved the terminal for the boolean into the even case. This will allow the boolean to reset itself.
3. Got rid of the local variables and just moved the Input terminal into the event case to write directly to the output.
4. Allowed the VI to stop when you attempt to close the front panel. The panel closing is being discarded so it will not actually close.
08-04-2017 11:08 AM - edited 08-04-2017 11:09 AM
@billko wrote:
Every operating system I know of uses mouse UP for a button click. Because the event won't fire until mouse UP, you have a chance to move off of the control before finishing the click. This cancels the command. May I enquire as to why the user needs this "instantaneous" input?
Sure. In application when time is sensitive.
In most applications such as word, excel, office or browser, user has plenty time to think.
Labview is more used for controlling hardware, sometime we need to fire a command instantly. Let me make an example, if you play shooting video game if the fire event delays after you press the mouse button, you may never hit the moving target.
08-04-2017 11:36 AM
@JiaLiGenmark wrote:
@billko wrote:
Every operating system I know of uses mouse UP for a button click. Because the event won't fire until mouse UP, you have a chance to move off of the control before finishing the click. This cancels the command. May I enquire as to why the user needs this "instantaneous" input?
Sure. In application when time is sensitive.In most applications such as word, excel, office or browser, user has plenty time to think.
Labview is more used for controlling hardware, sometime we need to fire a command instantly. Let me make an example, if you play shooting video game if the fire event delays after you press the mouse button, you may never hit the moving target.
That's exactly what I had imagined for your case. Sorry, that question was more for me than for you. I appreciate your reply and your confirmation of the reasoning behind your decision. 🙂
08-04-2017 12:31 PM - edited 08-04-2017 12:33 PM
@crossrulz wrote:
Here is my mod.
1. Changed the boolean to a control and set it to Latch When Pressed. This way, the value will change when the mouse is pressed down on the control.
2. Changed to event to be Value Changed and moved the terminal for the boolean into the even case. This will allow the boolean to reset itself.
3. Got rid of the local variables and just moved the Input terminal into the event case to write directly to the output.
4. Allowed the VI to stop when you attempt to close the front panel. The panel closing is being discarded so it will not actually close.
Thank you. Super satisfied.
The key is value change of the button.