Eclipse Question:

How to fire a key event in my test code to make the program act as if a user pressed a key?

Eclipse Interview Question
Eclipse Interview Question

Answer:

Two ways to implement it in code: generating OS level key event use Display.post(Event) or use Widge.notifyListeners(...) to just notify a widget's listeners.


Previous QuestionNext Question
How to access UI objects from a non-ui thread?Why do I get the error "org.eclipse.swt.SWTException: Invalid thread access"?