简体   繁体   中英

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 keyReleased 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM