开发者

In ExtJS, Using a DataView, How Can You Detect A Key Held Down?

开发者 https://www.devze.com 2023-01-12 16:45 出处:网络
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?

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
    }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号