Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] How to add key event filter for an application?

Title: Message
Hi,
 
Can I intercept key or mouse events before they are sent to widgets? I have checked API document and found Display class has addListener(int eventType, Listener listener) method. However, when I tried the following code snippet, it never got called at all when I pressed key.
 
     display.addListener(SWT.KeyDown, new Listener() {
          public ovid handleEvent(Event e) {
               System.out.println("Hello, world!");
          }
     });
 
Can anybody throw some light on this problem? Thanks.
 
 

Back to the top