I have a Canvas container that has many objects inside some of which are larger than the Canvas container itself. As a result, th Canvas container draws horizontal and vertical scrollbars in order to accomodate all the objects inside itself. The problem that I have is by pressing the keyboard left/right/up/down arrow keys, the scrollbars will scroll the Canvas container and I don't want that to happen.
I've tried setting the keyUp/keyDown event listeners to null but that doesn't seem to do anything.
How can I remove the keyboard controls for the Canvas container so that pressing the arrow keys will not scroll the Canvas?
The keyboard scrolling behaviour is implemented in the Container base class. Here's a couple of possible ways to switch it off (and I haven't tried either):
1) Extend Canvas, override the keyDownHandler with a blank method.
2) In the keyDown event for your Canvas try "event.stopImmediatePropagation()"
Thank you very much! Your suggestion about event.stopImmediatePropagation worked like a charm!