javascript - keyCode or which not working when using selection:cleared in fabric js -


i using fabric js , created designer user can design objects , delete objects.

but reason, user not able delete object because of event

before:selection:cleared 

so, want detect key user pressed, did is

canvas.on('before:selection:cleared', function(e) {     console.log(e.keycode);     console.log(e.which);     if(typeof(canvas.getactiveobject()) !== 'undefined') {                 if(jq.isemptyobject(previous_object)){                 }else{                     previous_object.moveto(prev_pos);                     previous_object={};                     prev_pos='';                 }                 loadlayers();             } }); 

but returns undefined. there other solution detect key?


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -