In ExtJS, Using a DataView, How Can You Detect A Key Held Down?
All, Using Ext JS (3.2), how is it possible to detect whether a user is pressing/holding down a specific key whilst performing another action with a DataView component?
The specific application is to see whether the control/shift key is depressed when a right click event occurs on a DataView node, if it is, the node is selected along with any others currently selected, if not- it replaces all other selections.
Many tha开发者_如何学JAVAnks in advance for the response!
You can check the event object for properties like shiftKey
, ctrlKey
, altKey
, etc. So it would be something like this (untested):
myDataView.on('contextmenu', function(dv, idx, node, e){
if(e.shiftKey){
// shift is pressed
}
});
精彩评论