Community
Participate
Working Groups
20011211 Run the following wad of code and hit CTRL Space in the StyledText widget. On Windows, you get the "Here" message, on Linux motif you do not. I have found that the value event.character is 0x20 on Windows but -1 on Linux motif. Since this value is just being copied from the KeyDown event, it is probably not an error in StyledText but above that. public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); StyledText text = new StyledText(shell, SWT.BORDER); text.setBounds(10, 10, 400, 400); text.addVerifyKeyListener(new VerifyKeyListener() { public void verifyKey(VerifyEvent event) { //do code assist for CTRL-SPACE if (event.stateMask == SWT.CTRL && event.keyCode == 0) { if (event.character == 0x20) { System.out.println("Here"); event.doit = false; } } } }); shell.open (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); }
Fixed. Workaround was needed for bug in XLookupString: it performs a lookup on CTRL-space, answers a result length of 1 (good), but does not fill the provided character buffer with anything (bad). We now handle this case.