Ctrl+Tab for selecting next dockable

Hi Beni,

does the framework support keyboard shortcuts for selecting next/previous dockable?
I already use the DockableSelector invoked with Ctrl+Shift+E which is very useful,
but I would also like to give the user the possibility to directly go to the next dockable.

Kind regards,
Maciej Modelski

Not at the moment. But there is a global KeyListener available (see CControl.addKeyboardListener), so implementing this functionality yourself should require about 5 lines of code. You could use AbstractCDockable.toFront to transfer focus.

Similar functionality is available for Core, see DockController.getKeyboardController…

hello,
can you explain an example how to replace Ctrl + Shift + E on Ctrl + Tab?

thanks

There is a property for this:


KeyStroke keyStroke = KeyStroke.getKeyStroke( KeyEvent.VK_TAB, KeyEvent.CTRL_DOWN_MASK );
control.putProperty( DockableSelector.INIT_SELECTION, keyStroke );```

i tried that, but it does not work. focus moves between components of dock.

Could it be that ctrl+tab is naturally used by the OS or by Swing to change the focus of components? Because the framework would have no chance of beating a key combination that is already in use.

Hello everyone.

Is it possible to hide a small window to select a Dockable (ctrl + shift + e) by releasing the CTRL key?

First of all, you can access that window, and close (or open) it yourself whenever you want. Like this:

DockableSelector selector = control.getController().getDockableSelector();

selector.cancel();```

You could do something like this:
```	final DockableSelector selector = control.getController().getDockableSelector();
	control.getController().getKeyboardController().addGlobalListener( new KeyAdapter() {
		public void keyReleased( KeyEvent e ) {
			if( e.getKeyCode() == KeyEvent.VK_CONTROL ){
				e.consume();
				selector.cancel();
			}
		}

		public void keyTyped( KeyEvent e ) {
			if( e.getKeyCode() == KeyEvent.VK_CONTROL ){
				e.consume();
				selector.cancel();
			}
		}
	} );

P.S. If you keep the keys pressed, then the dialog is quickly closing and opening again. The next version 1.1.2p14e will have that issue fixed.

what I need. thanks a lot.