I am trying to capture keyboard events when there isn’t a widget with the focus. I tried adding this to a composite widget :
addDomHandler(new KeyPressHandler(){
public void onKeyPress(KeyPressEvent event) {
logger.info("onKeyPress: "+event);
}
}, KeyPressEvent.getType());
but I am not trapping the keyboard events. I’d like to be able to determine when the Ctrl key is press whilst a mousedown event is occuring. How can I do that?
Use MouseDownHandler: