Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Key event listener and active keys: clear active keys doesn't work
Key event listener and active keys: clear active keys doesn't work [message #1739434] Mon, 01 August 2016 10:35 Go to next message
Nicola  Zanaga is currently offline Nicola ZanagaFriend
Messages: 52
Registered: July 2009
Member
I've a problem using "active keys" with key listener.
I initially setup a set of keys on the control, and this works.
But If I later clear the active keys, the result is wrong: the listener is disabled.
I expect intead to receive all keys.

Here the snippet:

        Shell shell = new Shell(display);

        Text t = new Text(shell, SWT.BORDER);
        t.setBounds(0, 0, 400, 400);

        t.setData("org.eclipse.rap.rwt.activeKeys", new String[] { "a", "b" });

        t.addKeyListener(new KeyAdapter() {
            @Override
            public void keyPressed(KeyEvent e) {
                System.out.println(e.character);

                if( e.character == 'a' ) {
                    t.setData("org.eclipse.rap.rwt.activeKeys", null);
                }
            }
        });

        shell.open();



In this snippet, when you press 'a', the listener will be disabled
Note: if you set another key sequence, for example: new String[] { "x", "y" }, then It works as expected

I'm use Rap 3.1
Re: Key event listener and active keys: clear active keys doesn't work [message #1740047 is a reply to message #1739434] Mon, 08 August 2016 07:46 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2285
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
please open a bugzilla with a snippet to reproduce it and we will look
on it.
Thanks,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Key event listener and active keys: clear active keys doesn't work [message #1740093 is a reply to message #1740047] Tue, 09 August 2016 07:11 Go to previous message
Nicola  Zanaga is currently offline Nicola ZanagaFriend
Messages: 52
Registered: July 2009
Member
bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=499402
Previous Topic:Disable browser 'save password' functionality
Next Topic:Toolbar focus has different behavior than SWT
Goto Forum:
  


Current Time: Wed Aug 22 04:04:31 GMT 2018

Powered by FUDForum. Page generated in 0.01636 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top