0

what is the code to use to move the gif image using the keyboard arrows?

Can someone help, please. what is the code to make the gif image using the keyboard up, down, left and right arrows move, please

21st Oct 2019, 1:50 AM
Maize 'G
Maize 'G - avatar
1 Answer
+ 1
you have to use eventListener with keyevents and then if the image is on a canvas translate the canvas, if the gif is not on a canvas or you want to move the whole canvas use css. https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent
21st Oct 2019, 4:29 AM
Anton Böhler
Anton Böhler - avatar