# all files / src/js/base/core/ key.js

100% Statements 9/9
100% Branches 0/0
100% Functions 4/4
100% Lines 8/8

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    921×
    1×
    1×
    1×
    1×

    1×

    3×

    2×

     (function(global){global.wrappers['/Users/lqez/Dev/summernote/src/js/base/core/key.js']=[function(require,module,exports,__dirname,__filename){ "use strict";
    exports.__esModule = true;
    var lists_1 = require("./lists");
    var func_1 = require("./func");
    var KEY_MAP = {
        'BACKSPACE': 8,
        'TAB': 9,
        'ENTER': 13,
        'SPACE': 32,
        'DELETE': 46,
        // Arrow
        'LEFT': 37,
        'UP': 38,
        'RIGHT': 39,
        'DOWN': 40,
        // Number: 0-9
        'NUM0': 48,
        'NUM1': 49,
        'NUM2': 50,
        'NUM3': 51,
        'NUM4': 52,
        'NUM5': 53,
        'NUM6': 54,
        'NUM7': 55,
        'NUM8': 56,
        // Alphabet: a-z
        'B': 66,
        'E': 69,
        'I': 73,
        'J': 74,
        'K': 75,
        'L': 76,
        'R': 82,
        'S': 83,
        'U': 85,
        'V': 86,
        'Y': 89,
        'Z': 90,
        'SLASH': 191,
        'LEFTBRACKET': 219,
        'BACKSLASH': 220,
        'RIGHTBRACKET': 221
    };
    /**
     * @class core.key
     *
     * Object for keycodes.
     *
     * @singleton
     * @alternateClassName key
     */
    exports["default"] = {
        /**
         * @method isEdit
         *
         * @param {Number} keyCode
         * @return {Boolean}
         */
        isEdit: function (keyCode) {
            return lists_1["default"].contains([
                KEY_MAP.BACKSPACE,
                KEY_MAP.TAB,
                KEY_MAP.ENTER,
                KEY_MAP.SPACE,
                KEY_MAP.DELETE,
            ], keyCode);
        },
        /**
         * @method isMove
         *
         * @param {Number} keyCode
         * @return {Boolean}
         */
        isMove: function (keyCode) {
            return lists_1["default"].contains([
                KEY_MAP.LEFT,
                KEY_MAP.UP,
                KEY_MAP.RIGHT,
                KEY_MAP.DOWN,
            ], keyCode);
        },
        /**
         * @property {Object} nameFromCode
         * @property {String} nameFromCode.8 "BACKSPACE"
         */
        nameFromCode: func_1["default"].invertObject(KEY_MAP),
        code: KEY_MAP
    };

    },'src/js/base/core/key.js',{"./lists":"/Users/lqez/Dev/summernote/src/js/base/core/lists.js","./func":"/Users/lqez/Dev/summernote/src/js/base/core/func.js"}];})(this);
    //# sourceMappingURL=data:application/json;charset=utf-8;base64,