PDA

View Full Version : Keyboard shortcuts and wrapping Ext JS



EPV
14 Apr 2012, 3:38 AM
Been struggeling with the issues of using keyboard navigation in an Ext JS web application.

Is it possible to use keys like "ctrl+s", "Backspace" or "F1" without messing with the browser?

A fix would possible be to wrap the web-page in Titanium Desktop. Anyone with good/bad experinces with this? Other options?

Thanks / E

mitchellsimoens
16 Apr 2012, 8:04 AM
This captures ctrl + s:


new Ext.util.KeyMap(document.body, {
key : 's',
ctrl : true,
fn : function(keycode, e) {
e.stopEvent();

console.log('ctrl + s was pressed');
}
});

I'm on Mac and the browser doesn't launch the save so I'm not sure if stopEvent will prevent the browser behavior.

Wonder if the keydown event would be better.