How to detect ctrl-f in my SWT application
问题 I have written an SWT UI which has a primary function of displaying text in a StyledText control. I want to add a handler for Ctrl + F so that when that shortcut is pressed the focus is set to a search box. I have tried using the following code to detect the keypress. sWindow = new Shell(); ... sWindow.getDisplay().addFilter(SWT.KeyDown, new Listener() { @Override public void handleEvent(Event e) { System.out.println("Filter-ctrl: " + SWT.CTRL); System.out.println("Filter-mask: " + e