SWT: KeyPressed Event After Done
I'm creating a text box that automatically completes the input from a list. For example, if you enter 345
, it might check the list and find 345678
, and then the text box has 345
, and then 678
highlighted.
http://nucleussystems.com/files/Screenshot.png
This way, if you continue typing something different, it removes the automatically appended text.
I tried doing it with the keyRe开发者_StackOverflowleased event, but there were user experience problems if more than one key was pressed at a time (something very common when typing fast). But I soon found out that the keyPressed event doesn't add the text typed until after the event handler(s) is/are called.
So I need to find out a way to fire my event handler after SWT has handled it. Is this possible?
I think SWT.Modify event can provide what you need. Have a look at the ModifyListener documentation.
精彩评论