How can prevent default shortcuts "Home & End"?

I found the shortcuts defined in CommandeHandler always invoke some method except “Home & End” which just “set” the position value. How can I prevent default “Home & End” action?
A further question: Why not let the “Home & End” invoke “Diagram.scroll” like “PageUp & PageDown” does? I think they perform similar.

Override CommandHandler.doKeyDown to do nothing when those keys are typed. See http://gojs.net/latest/intro/commands.html.

Regarding your second question, in version 1.6:

  • Added “document” as a new kind of unit argument to Diagram.scroll, called by the CommandHandler when handling the Home and End keys.

See http://gojs.net/beta/doc/changelog.html.