Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Forwarding keystrokes from one Widget to another.

Open a bug report (https://bugs.eclipse.org/bugs/enter_bug.cgi) with the 
test case.

Regards
Felipe




From:
Carson Day <carsonday@xxxxxxxxx>
To:
platform-swt-dev@xxxxxxxxxxx
Date:
06/12/2009 02:46 PM
Subject:
[platform-swt-dev] Forwarding keystrokes from one Widget to another.
Sent by:
platform-swt-dev-bounces@xxxxxxxxxxx



Hello,
    I am trying to forward keystrokes between two a StyledText and a Text. 
When the StyledText has focus I want to forward most key strokes to the 
Text. I am using swt 3.6M3. This is a trimmed down version of the code I 
currently have:

styledText.addKeyListener(new KeyAdapter() {

        @Override
        public void keyReleased(KeyEvent event) {
            //Some filtering has been left out that checks for certain 
characters.
            processKeystroke(event);
        }
    });

void processKeystroke(KeyEvent event) {
text.append("" + event.character);
}

This works quite well in OS X and Linux even if the user types fast. I 
manage to catch all of the keystrokes and they are forwarded without any 
issues. However, in windows some keystrokes are missed. If the user types 
"this is a test" really quickly I will see output like "his isa test" in 
the Text. I was wondering if anyone had any suggestions or other ideas to 
try. Also is it possible to publish a KeyEvent on the Text 
programatically?

Thanks,
Carson Day_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev





Back to the top