03-07-2016 07:28 PM
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,
Solved! Go to Solution.
03-07-2016 08:19 PM
03-07-2016 08:53 PM - edited 03-07-2016 08:56 PM
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.
03-08-2016 05:04 AM
@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.
03-08-2016 06:41 AM
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
03-08-2016 06:50 AM
@Bob_Schor wrote:...Fabiola de la Cueva (a "fabulous" LabVIEW developer)...
Also known as The Queen of Delacor.
03-08-2016 07:09 AM
03-08-2016 07:56 AM - edited 03-08-2016 07:57 AM
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.
03-10-2016 02:05 PM
@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.
03-10-2016 02:21 PM
@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,