From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change space bar behavior

Solved!
Go to solution

Concerning this ongoing UI improvement project: http://forums.ni.com/t5/LabVIEW/keyboard-focus-on-indicators/m-p/3260505#M951052

 

I'd like to use the space bar to 'tab' among controls. Playing around with the UI, I soon realized that space bar currently performs the ENTER key function, i.e., toggles a control if it's in focus. Will setting up the tab function for space bar preclude it from also performing the ENTER function? How could I set it up in the event structure for the UI controls?

 

Thanks,

 

 

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 1 of 10
(6,885 Views)
It all depends on how the code is currently written. How is the space bar triggering "enter" key functions? Key press events?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 10
(6,866 Views)
Solution
Accepted by topic author MinerHokieRamp

First:  My advice is "Do not do this!"  Tabbing control focus is a normal windows behavior.  Space bar doing anything other than space is abnormal- In fact, those of us that do not use auto-tool select are called "Tabbers" not "Spacers" although the space bar performs a simillar tool scroll function!  Most "Tabbers" don't even know that because Tab is more consistant with "Normal" apps.  Select a key and any desired modifier(s) that is already populated in the control properties key navigation tab.

 

Now, after hearing that advice, you still feel you NEED to redirect the spacebar- You can hack the enum that populates the property editor drop-down list.  But, I strongly advise against it.  Better, talk to the users and get their "Story" on how they would ideally navigate the UI with a frank discussion on their experiences with other applications and what this application can help them do.


"Should be" isn't "Is" -Jay
Message 3 of 10
(6,851 Views)
Solution
Accepted by topic author MinerHokieRamp

@mikeporter wrote:
How is the space bar triggering "enter" key functions?

That is a default behavior.  If you get focus on a boolean control, pressing the space bar will toggle it and keep the focus.  Pressing "enter" will toggle the control and reset the focus to nothing.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 10
(6,811 Views)
Solution
Accepted by topic author MinerHokieRamp

I have to strongly agree with Jeff.  I listened to a very entertaining talk by Fabiola de la Cueva (a "fabulous" LabVIEW developer) about Really Good LabVIEW Habits, one of which was "Give the User What They Expect".  Now, you can (in LabVIEW) trap and remap the keys so when you type "a", it echoes "b", and when you type "space", it acts like a "tab".  But if I did this, then when I typed the word "cbt", you would not think of b smbll bnimbl thbt purrs, would you?  [OK, I'll chbnge the "b" back to "a", but you see how confusing this "remapping" can become ...].

 

Bob Schor

0 Kudos
Message 5 of 10
(6,795 Views)

@Bob_Schor wrote:

...Fabiola de la Cueva (a "fabulous" LabVIEW developer)...


Also known as The Queen of Delacor.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 10
(6,786 Views)
Solution
Accepted by topic author MinerHokieRamp
I basically agree Bob, but "giving the user what they expect" can be a double edged sword sometimes. I once had an application where there were several numeric fields that had to be populated manually. The operators were trained to enter this data using the numeric keypad. In that situation they expected the enter key on the keypad to work like the tab. Now you might argue with their position and perhaps understanding, but that was their expectation.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 10
(6,780 Views)
Solution
Accepted by topic author MinerHokieRamp

Ignoring for a moment the others' comments about standard behavior (there certainly are cases where deviations from the standard are reasonable), I should point out that you're starting down the rabbit hole of workarounds we talked about in the other thread. The more you do this, the more likely you are to have to solve more of these issues. As long as you don't include dedicated hardware to do these input tasks, you will either need to use the standard behavior or come up with a dedicated set of behaviors for the UI and make sure both the users and program understand them.

 


@MinerHokieRamp wrote:

Will setting up the tab function for space bar preclude it from also performing the ENTER function?

Yes if it's in the same controls since you won't know if you want to tab or enter. If it's on separate controls you can use the Key Down? event for the different controls and use the discard terminal to decide if you accept it or not. Enjoy the rabbit hole.


___________________
Try to take over the world!
0 Kudos
Message 8 of 10
(6,767 Views)

@mikeporter wrote:
It all depends on how the code is currently written. How is the space bar triggering "enter" key functions? Key press events?

Mike...

It's default behavior. There's no event that sets this behavior.

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 9 of 10
(6,644 Views)

@MinerHokieRamp wrote:

Concerning this ongoing UI improvement project: http://forums.ni.com/t5/LabVIEW/keyboard-focus-on-indicators/m-p/3260505#M951052

 

I'd like to use the space bar to 'tab' among controls. Playing around with the UI, I soon realized that space bar currently performs the ENTER key function, i.e., toggles a control if it's in focus. Will setting up the tab function for space bar preclude it from also performing the ENTER function? How could I set it up in the event structure for the UI controls?

 

Thanks,

 

 


Thanks for the many comments. I'll just leave the spacebar function as-is. I agree with all the comments on exepecting standard behavior. If an operator discovers the unexpected behavior of the spacebar, it's not a real problem. And as far as tabbing among controls, staying with the tab key will be fine.

 

Thanks again,

 

 

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 10 of 10
(6,627 Views)