PDA

View Full Version : How to set the type of specialkey event for the keypress?



manlsea
23 Jul 2012, 11:33 PM
The 'specialkey' is one of event in Ext.form.field.Base; Its trigger type is keydown, Fires when key is press down. So can only capture a key.
According to the debug information:
altKey: undefined
charCode: 0
ctrlKey: false
keyCode: 17
relatedTarget: undefined
shiftKey: false
type: "keydown"

but,I want to capture the key combination.
How to set the type of specialkey event for the keypress?

Farish
23 Jul 2012, 11:47 PM
how about creating a key map?


var keyMap = Ext.create('Ext.util.KeyMap', Ext.getBody(), [
{
key: Ext.EventObject.R,
shift: true,
ctrl: false, // explicitly set as false to avoid collisions
fn: function() {
// Do something on Shift+R press
}
}
]);