Documentation
    Preparing search index...

    Interface KeySurface

    The event source key events arrive on, described by what this module actually touches — the same structural-seam policy PointerSurface follows, and for the same reasons.

    In a browser this is normally window or document rather than the canvas: an element receives key events only while it holds the DOM's focus, and the canvas of a scene whose focus model is §75's does not want the DOM's. Both satisfy this interface structurally, as does any object with the two methods.

    There is deliberately no runtime validation of the argument, for the reason PointerSurface gives: it is a checked parameter type, and §89 has no error code for "wrong argument".

    interface KeySurface {
        addEventListener(type: string, listener: SurfaceKeyListener): void;
        removeEventListener(type: string, listener: SurfaceKeyListener): void;
    }
    Index