CTRL + UP event

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

CTRL + UP event

Postby andrewbrook » Tue Jun 29, 2010 9:55 am

Hi,

Our code uses accelerators to capture CTRL+UP, CTRL+DOWN, etc...
Works fine, but when a JIDE component is selected/active the CTRL+UP operation is no longer called. All other directions work (DOWN, LEFT, RIGHT,...).
Is there any reason why JIDE might override the behavior of this keyboard event?

Andrew
andrewbrook
 
Posts: 4
Joined: Fri May 28, 2010 1:23 pm

Re: CTRL + UP event

Postby JIDE Support » Tue Jun 29, 2010 11:11 am

May I ask which JIDE component you have issue with and how you set the accelarators for CTRL+UP?

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: CTRL + UP event

Postby andrewbrook » Tue Jun 29, 2010 11:29 am

Docking Framework (in particular the DockableFrame being active seems to cause the behaviour)

We set accelerators exactly the same for all directions:
Code: Select all
setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_UP, java.awt.event.InputEvent.CTRL_MASK));
andrewbrook
 
Posts: 4
Joined: Fri May 28, 2010 1:23 pm

Re: CTRL + UP event

Postby JIDE Support » Tue Jun 29, 2010 6:23 pm

CTRl-UP and CTRL-DOWN are used by many JComponents (such as JTextArea, JList, ...) so it may not be a good idea to use these two keystrokes. In your particular case, JideTabbedPane's InputMap uses this two keystrokes. We didn't invent this. We follow JTabbedPane which uses the keys. The code below is from BasicLookAndFeel.java. In our code, we have the same keys for "JideTabbedPane.focusInputMap" and "JideTabbedPane.ancestorInputMap". So the only way to workaround this if you have to use these two keystrokes is to override the input map defined in the UIManager.

Code: Select all
       "TabbedPane.focusInputMap",
         new UIDefaults.LazyInputMap(new Object[] {
               "RIGHT", "navigateRight",
                 "KP_RIGHT", "navigateRight",
                     "LEFT", "navigateLeft",
                  "KP_LEFT", "navigateLeft",
                       "UP", "navigateUp",
                    "KP_UP", "navigateUp",
                     "DOWN", "navigateDown",
                  "KP_DOWN", "navigateDown",
                "ctrl DOWN", "requestFocusForVisibleComponent",
             "ctrl KP_DOWN", "requestFocusForVisibleComponent",
      }),
       "TabbedPane.ancestorInputMap",
          new UIDefaults.LazyInputMap(new Object[] {
         "ctrl PAGE_DOWN", "navigatePageDown",
                "ctrl PAGE_UP", "navigatePageUp",
                     "ctrl UP", "requestFocus",
                  "ctrl KP_UP", "requestFocus",
       }),


Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 73 guests