tags:

views:

128

answers:

2

I'm using GWT and GXT and want to use keyboard shortcuts like CTRL-S (or CTRL-SHIFT-S) to save the current form. Problem is, I can't figure out how to override the browsers built-in CTRL-S. I tried using a componentEvent and calling stopevent, cancelbubble, etc with no luck. I also tried using

Event.addNativePreviewHandler(new Event.NativePreviewHandler(){  
}

and calling event.getNativeEvent().preventDefault(); to try and stop the event but that doesn't work either.

I'm at the point where i can get my keyboard shortcuts to work, but they also fire the browser's event too (like opens a browser save dialog)

Anyone have an idea/hint on how to get this to work? I actually have a number of shortcuts I want to use but many conflict with the browser - just trying to figure out how to override the browser's actions.

A: 

To answer my own question - we opted to go with CTRL+ALT shortcuts which don't conflict with any built-in browser keyboard shortcuts.

VogonPoet
A: 

U can cancel the event bubbling by which u can stop further process, which stop propagation.

Subhrajyoti Majumder
yeah - I tried that but it didn't work for me.
VogonPoet