Community
Participate
Working Groups
Hi, I have written already the problem at http://www.eclipse.org/forums/index.php/t/263057/ I'm managing autocomple text assist with RAP 1.5 with ContentProposalAdapter, it works well except that I cannot open the popup with Ctrl+Space. I have debugged RAP code and the when I do Ctrl+Space I go at ActiveKeysUtil#processEvent : -------------------------------------------------------- private static void processEvent( Display display, Event event ) { IFilterEntry[] filters = getFilterEntries( display ); for( int i = 0; i < filters.length; i++ ) { if( filters[ i ].getType() == event.type ) { filters[ i ].getListener().handleEvent( event ); } } } private static IFilterEntry[] getFilterEntries( Display display ) { IDisplayAdapter adapter = display.getAdapter( IDisplayAdapter.class ); return adapter.getFilters(); } -------------------------------------------------------- There is not filter for my autocomplete. So I have getted the ControlListener added by ContentProposalAdapter to my SWT Text firstNameText and add this listner to the Display.getCurrent() like this : -------------------------------------------------------- Listener l =firstNameText.getListeners(SWT.KeyDown)[0]; Display.getCurrent().addFilter(SWT.KeyDown, l); firstNameText.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent event) { Listener l =firstNameText.getListeners(SWT.KeyDown)[0]; Display.getCurrent().removeFilter(SWT.KeyDown, l); } }); -------------------------------------------------------- If it's right way, I think this code shoulb be done in the ContentProposalAdapter class. Regards Angelo
The activation of the proposals popup with a keystroke combination ( KeyStroke.getInstance( "CTRL+c" ) in your case) is handled in ContentProposalAdapter#controlListener. Due to some limitations/issues with the client-side key event handling (SyncKeyEventUtil/AsyncKeyEventUtil), combinations with CTRL does not work in Firefox. In other browsers I found that the keyCode/charCode is wrong when modifier is used. Please note that the current key events implementation was created to serve the cell editors needs (Bug 225764) and has some limitations for using it for a generic purpose.
The key events have been refactored, this should work now. Can someone confirm this?
Fixed by enable the corresponding key events code in the ContentProposalAdapter class.