Arrow keys Keyboard Event

I am trying to capture the keydown event for the arrow keys instead of getting the event of canvas is get moved but in the keydown I didn’t get event but the same arrow event i am getting in the keyup this im trying to capture this event to move the node based on arrow key press how I can move the node right left, up, down based on the keyboard event
I am currently using GOJS version 2.2.0

It might be easiest to use the DrawCommandHandler extension: DrawCommandHandler | GoJS API

There is a demonstration of that extended CommandHandler at: Drawing Commands for Aligning, Spacing, Rotating, Z-Ordering, and Arrow Keys | GoJS Diagramming Library

You could also just extract the relevant code from the implementation in extensions/DrawCommandHandler.js or extensionsJSM/DrawCommandHandler.ts, if you don’t want the rest of the functionality of that extension.