Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] getting key events....

Hello everybody,

In my current SWT application, I wanted to have a 
multiline Text (equivalent to an AWT text area) and 
wanted to capture the enter key event. I tried with 
the KeyListner but the keyCode returned is 0 (zero) 
for all keys and no character (in KeyEvent class) is 
returned for keys like enter, backspace, spacebar etc.

I also tried with combinations of Listeners 
(modify/verify/key) but did not succeed.

Instead if we use single line text then it works, 
somthing like...

Text t = new Text(_shellPCon, SWT.BORDER |
SWT.SINGLE);
t.addListener (SWT.DefaultSelection, new Listener () {
    public void handleEvent (Event e) {
      doSomething();
    }
});

In short, what is the alternate of 
java.awt.event.KeyEvent.VK_ENTER?

Note: thanks very much guys, for the SWT specification

clue.

nmg.


__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/


Back to the top