Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Keyboard controlling a scout application
Keyboard controlling a scout application [message #1064472] Wed, 19 June 2013 08:32 Go to next message
Urs Beeli is currently offline Urs Beeli
Messages: 324
Registered: October 2012
Location: Bern, Switzerland
Senior Member
I have a number of questions about making a scout application usable using the keyboard only.

Menus
It seems that adding an ampersand (&) to the menu texts does not make the following letter act as a shortcut to open the menu together with the alt key (I'm talking windows here Smile
Instead it seems that Alt plus the first letter of the menu text puts the focus on the menu bar, repeatedly pressing the same letter switches between main menu entries with the same letter. Pressing the down arrow opens the menu and then pressing the first letter of a submenu entry either executes that entry (if it is the only one starting with that letter) or again switches between entries with the same starting letter.

While this works, it is counter intuitive to most other applications.

--> What do I need to do in order for scout to (a) user and (b) show keyboard short cuts on menus and submenus? Especially shortcut letters that are not the first letter of a menu?

Navigating between views
I seem to be unable to navigate from one view to another using the keyboard? Is there I default keybinding to do this that I am unaware of? If not, how can I set this up?

Alternatively (or additionally): How do I assign a key binding with which I can set the focus to a certain view?

FormField short cuts
Is there a way to define shortcuts to jump to certain form fields? In other applications I've done this using the ampersand (&) in the label name which shows the corresponding letter underlined, pressing ALT plus that letter will set the focus to that field.
Using the ampersand in the name of a field does show the underline (though only after pressing ALT once) but using that letter does not seem to have any effect. How do I change this?
Re: Keyboard controlling a scout application [message #1064493 is a reply to message #1064472] Wed, 19 June 2013 09:44 Go to previous messageGo to next message
Urs Beeli is currently offline Urs Beeli
Messages: 324
Registered: October 2012
Location: Bern, Switzerland
Senior Member
And as a follow-up question: In the outline tree, when I move to another entry in the tree, the corresponding page is shown, stealing the focus from the outline tree. This makes it impossible to move through the outline tree using the keyboard. Is there any way to fix this?
Re: Keyboard controlling a scout application [message #1064500 is a reply to message #1064493] Wed, 19 June 2013 10:03 Go to previous messageGo to next message
Urs Beeli is currently offline Urs Beeli
Messages: 324
Registered: October 2012
Location: Bern, Switzerland
Senior Member
And another follow-up question: I have one page that contains a form directly in a view. If I place the cursor into a FormField of that form, using ALT+<letter> no longer works to access the main menu. Can this be changed somehow?
Re: Keyboard controlling a scout application [message #1143779 is a reply to message #1064472] Fri, 18 October 2013 08:20 Go to previous messageGo to next message
Matthias Nick is currently offline Matthias Nick
Messages: 163
Registered: August 2013
Senior Member
Hi Urs,

thank you very much for your question, I think this is a very interesting topic and will be useful to many other developers as well. I will try to answer some of your questions, If you think I am not correct or see a better way to solve the problems, please correct me.


Quote:

Menus
It seems that adding an ampersand (&) to the menu texts does not make the following letter act as a shortcut to open the menu together with the alt key (I'm talking windows here Smile
Instead it seems that Alt plus the first letter of the menu text puts the focus on the menu bar, repeatedly pressing the same letter switches between main menu entries with the same letter. Pressing the down arrow opens the menu and then pressing the first letter of a submenu entry either executes that entry (if it is the only one starting with that letter) or again switches between entries with the same starting letter.

While this works, it is counter intuitive to most other applications.

--> What do I need to do in order for scout to (a) user and (b) show keyboard short cuts on menus and submenus? Especially shortcut letters that are not the first letter of a menu?

You are absolutely right here, thank you for the catch! It seems that the mnemonics in SWT are broken. I also tried the mnemonics in Swing, and there they are working. Nevertheless I opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=419831. When this bug has been resolved the navigation, as described by you, should work.


Quote:

Navigating between views
I seem to be unable to navigate from one view to another using the keyboard? Is there I default keybinding to do this that I am unaware of? If not, how can I set this up?

Alternatively (or additionally): How do I assign a key binding with which I can set the focus to a certain view?

I think there is no such functionality in Scout. However I can think of Eclipse's shortcut for switching views "Alt+Shift+Q". Would a functionality like this solve your problem?

Quote:

FormField short cuts
Is there a way to define shortcuts to jump to certain form fields? In other applications I've done this using the ampersand (&) in the label name which shows the corresponding letter underlined, pressing ALT plus that letter will set the focus to that field.
Using the ampersand in the name of a field does show the underline (though only after pressing ALT once) but using that letter does not seem to have any effect. How do I change this?

I have tried the mnemonic (&) in SWT with textfields and checkboxes. They work on checkboxes but not on textfields. This should be improved in future version of Scout, thanks for that catch. Alternatively you could define a keystroke in the MainBox and then request the focus of the field:
    @Order(10.0)
    public class MyKeyStroke extends AbstractKeyStroke {

      @Override
      protected String getConfiguredKeyStroke() {
        return "F3";
      }

      @Override
      protected void execAction() throws ProcessingException {
        getXYField().requestFocus();
      }
    }


Quote:

follow-up question: In the outline tree, when I move to another entry in the tree, the corresponding page is shown, stealing the focus from the outline tree. This makes it impossible to move through the outline tree using the keyboard. Is there any way to fix this?

Again, you are absolutely right, selecting a node in the tree should not steal the focus. I also tried this with our Swing functionality, and there it works as expected. Nevertheless I opened bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=419813 for this. Once the bug has been fixed, keyboard navigation should be possible within the tree.

Quote:

follow-up question: I have one page that contains a form directly in a view. If I place the cursor into a FormField of that form, using ALT+<letter> no longer works to access the main menu. Can this be changed somehow?

I agree again. I think once https://bugs.eclipse.org/bugs/show_bug.cgi?id=419831 has been fixed, this problem will disappear as well.


I hope my answers will help you.
Greetings from Munich,
Matthias
Re: Keyboard controlling a scout application [message #1147944 is a reply to message #1143779] Mon, 21 October 2013 02:40 Go to previous message
Urs Beeli is currently offline Urs Beeli
Messages: 324
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Hi Matthias

Thank you for your answers and for opening the bugs. It would be nice if the mnemonics worked for textfields as well as checkboxes. The workaround with the keystroke would work but we would loose a lot of flexibility (today our users can maintain the NLS texts for each language by themselves, changing a shortcut is as easy as moving the & in the NLS text). The described workaround would mean that we would need to maintain an additional "NLS-text" with the language specific shortcut and as far as I can see, there would be no indication which letter is the shortcut for which field.
Previous Topic:HTTPS with Scout
Next Topic:Page size on IOS 7 too big
Goto Forum:
  


Current Time: Wed Aug 27 13:23:14 EDT 2014

Powered by FUDForum. Page generated in 0.02087 seconds