OpenLayers OpenLayers

Changeset 3702

Show
Ignore:
Timestamp:
07/11/07 13:51:12 (1 year ago)
Author:
tschaub
Message:

documenting keyMask, checkModifiers, and the Handler constants associated with them

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Handler.js

    r3658 r3702  
    2929OpenLayers.Handler = OpenLayers.Class.create(); 
    3030 
     31/** 
     32 * Constant: OpenLayers.Handler.MOD_NONE 
     33 * If set as the <keyMask>, <checkModifiers> returns false if any key is down. 
     34 */ 
    3135OpenLayers.Handler.MOD_NONE  = 0; 
     36 
     37/** 
     38 * Constant: OpenLayers.Handler.MOD_SHIFT 
     39 * If set as the <keyMask>, <checkModifiers> returns false if Shift is down. 
     40 */ 
    3241OpenLayers.Handler.MOD_SHIFT = 1; 
     42 
     43/** 
     44 * Constant: OpenLayers.Handler.MOD_CTRL 
     45 * If set as the <keyMask>, <checkModifiers> returns false if Ctrl is down. 
     46 */ 
    3347OpenLayers.Handler.MOD_CTRL  = 2; 
     48 
     49/** 
     50 * Constant: OpenLayers.Handler.MOD_ALT 
     51 * If set as the <keyMask>, <checkModifiers> returns false if Alt is down. 
     52 */ 
    3453OpenLayers.Handler.MOD_ALT   = 4; 
    3554 
     
    5675 
    5776    /** 
    58      * Property: keyMask 
    59      * {Integer} 
     77     * APIProperty: keyMask 
     78     * {Integer} Use bitwise operators and one or more of the OpenLayers.Handler 
     79     *     constants to construct a keyMask.  The keyMask is used by 
     80     *     <checkModifiers>.  If the keyMask matches the combination of keys 
     81     *     down on an event, checkModifiers returns true. 
     82     * 
     83     * Example: 
     84     * (code) 
     85     *     // handler only responds if the Shift key is down 
     86     *     handler.keyMask = OpenLayers.Handler.MOD_SHIFT; 
     87     * 
     88     *     // handler only responds if Ctrl-Shift is down 
     89     *     handler.keyMask = OpenLayers.Handler.MOD_SHIFT | 
     90     *                       OpenLayers.Handler.MOD_CTRL; 
     91     * (end) 
    6092     */ 
    6193    keyMask: null, 
     
    103135 
    104136    /** 
    105      * Method: checkModifiers  
     137     * Method: checkModifiers 
     138     * Check the keyMask on the handler.  If no <keyMask> is set, this always 
     139     *     returns true.  If a <keyMask> is set and it matches the combination 
     140     *     of keys down on an event, this returns true. 
     141     * 
     142     * Returns: 
     143     * {Boolean} The keyMask matches the keys down on an event. 
    106144     */ 
    107145    checkModifiers: function (evt) {