Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » [neon] overriding browser shortcuts to be used as KeyStroke
[neon] overriding browser shortcuts to be used as KeyStroke [message #1732604] Wed, 18 May 2016 13:08 Go to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 573
Registered: October 2012
Location: Bern, Switzerland
Senior Member
In our application which we have migrated from Mars to Neon we have various keystrokes (e.g. F1) which do not work in the Neon application because the browser catches those keys (in our example, F1 opens the browser help, instead of doing what our keystroke was supposed to do).

We noticed that F5 which normally does a browser reload no longer does so, but instead does a refresh of the table page in the scout application. So obviously, there is a way to make sure keystrokes are passed to the application by the browser even if those keystrokes are usually already taken by the browser.

How can this be done?
Re: [neon] overriding browser shortcuts to be used as KeyStroke [message #1732608 is a reply to message #1732604] Wed, 18 May 2016 06:25 Go to previous messageGo to next message
Arthur van Dorp is currently offline Arthur van DorpFriend
Messages: 48
Registered: October 2015
Member
DesktopKeyStroke.js is the JavaScript-Code handling this. I don't know this part of the code well enough to help you with customizing it though. And it is always possible, that the browser nonetheless handles some keystrokes itself, no matter what.
Re: [neon] overriding browser shortcuts to be used as KeyStroke [message #1732638 is a reply to message #1732608] Wed, 18 May 2016 17:55 Go to previous messageGo to next message
Rene Eigenheer is currently offline Rene EigenheerFriend
Messages: 109
Registered: July 2009
Senior Member
Does anybody know, what is the preferred way to extend default js files?

With the theme mechanism I can add functionality, but can I also extend?

How can I overwrite the line
this.blackListKeys = [keys.F5];
in DesktopKeyStroke.js ?
Re: [neon] overriding browser shortcuts to be used as KeyStroke [message #1733132 is a reply to message #1732638] Tue, 24 May 2016 16:27 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 256
Registered: March 2010
Senior Member
DesktopKeyStroke.js is propably not what you are looking for. This special type of a keystroke is only active when a busy indicator is visible. See javadoc at the header of the class for details.

You can define keystrokes as it was possible with the previous scout releases. If you want to trigger a button or menu, use the appropriate property on that element.
getConfiguredKeyStroke() {
  return IKeyStroke.F9;
}

These keystrokes are visible when the user presses F1.

If there is no button or menu you can assign the keystroke to, just add a keystroke to your form field, group box or the desktop. If it is added to the desktop it is always available.

public class YourKeyStroke extends AbstractKeyStroke {

    @Override
    protected String getConfiguredKeyStroke() {
      return IKeyStroke.F8;
    }

    @Override
    protected void execAction() {
    }
  }


What I don't understand: You said F1 shows the browser help? This should not happen, instead the keystrokes should be shown.
Maybe it was a focus issue. Can you click into the application before pressing F1 the next time? If the focus is on a browser element like the address bar the application keystrokes don't work. Does this help?
Re: [neon] overriding browser shortcuts to be used as KeyStroke [message #1733199 is a reply to message #1733132] Wed, 25 May 2016 11:16 Go to previous messageGo to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 573
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Quote:
What I don't understand: You said F1 shows the browser help? This should not happen, instead the keystrokes should be shown.


I probably got confused. The key issue is that we assigned F1 as an in-application hotkey but it didn't do what we expected, instead of that, doing something else. That something else is probably show the other key strokes and I mis-wrote that it displayed the help file.

The question remains: How can we make sure that our application can use F1 as a keystroke?
Re: [neon] overriding browser shortcuts to be used as KeyStroke [message #1733748 is a reply to message #1733199] Tue, 31 May 2016 12:02 Go to previous message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 256
Registered: March 2010
Senior Member
There is currently no official way to replace the F1 keystroke since it is not intended. If you still want to do it you would need to adjust the JavaScript code, more concrete the _isHelpKeyStroke function in KeyStrokeManager.js. An explanation on how to do it can be found here: http://stackoverflow.com/questions/37523962/eclipse-scout-neon-table-cell-mouseover
Previous Topic:[neon] Async loading on form
Next Topic:UiServletFilter in Scout 6.0.0.RC2
Goto Forum:
  


Current Time: Fri Apr 26 19:08:59 GMT 2024

Powered by FUDForum. Page generated in 0.04688 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top