javascript - How to listen keyboard events on svg -
i have svg , can draw multiple shapes on svg. requirement want listen keyboard events ctrl+c, ctrl+v, ctrl+d, esc, delete can copy, paste , duplicate selected shape. have no idea listening keyboard events on svg . tried following code no luck !!
mysvg.on("keydown", function () { //code handle keydown });
any ? in advance.
because svg not input-type, listen event on window instead:
$(window).on('keypress', function (evt){ ... })
Comments
Post a Comment