Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » keyPressed event lacks propper stateMask on first event?
keyPressed event lacks propper stateMask on first event? [message #1007508] Wed, 06 February 2013 04:00 Go to previous message
Markus Duft is currently offline Markus Duft
Messages: 44
Registered: February 2013
Member
Hey!

I have a slight problem detecting whether ctrl is pressed in a key event. i hook this on a Text:

@Override
public void keyPressed(KeyEvent e) {
    System.out.println("key: " + e.keyCode + ", " + e.stateMask);
    // get the current date and apply to the field
    if (e.stateMask == SWT.CTRL && e.keyCode == SWT.ARROW_RIGHT) {
        System.out.println("yeah!");
    }
}


when i run this and press ctrl+right arrow i'd expect to get "yeah!". however i get this:

key: 262144, 0
key: 16777220, 0


seems the ctrl state is missing from the statemask, even though the ctrl press was recognized. as rap sends a keyup for all keys immediately (it does, right?) i get a keyup for ctrl immediately, thus i also cannot remember the state myself.

interesting thing is, that keeping ctrl pressed and pressing right arrow a second time yields this:

key: 262144, 0
key: 16777220, 0
key: 16777220, 262144


any insights? thanks in advance!

Markus
 
Read Message
Read Message
Read Message
Previous Topic:SWT Resources RAP
Next Topic:RAP Tycho build Bug
Goto Forum:
  


Current Time: Thu May 23 08:51:28 EDT 2013

Powered by FUDForum. Page generated in 0.01756 seconds