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 - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -