24 lines
2.6 KiB
JavaScript
24 lines
2.6 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.calculateMouseButtonValue = exports.calculateKeyModifiersValue = void 0;
|
|
const types_1 = require("./types");
|
|
function calculateKeyModifiersValue(modifiers) {
|
|
let result = 0;
|
|
if (modifiers.ctrl)
|
|
result |= types_1.KeyModifierValues.ctrl;
|
|
if (modifiers.alt)
|
|
result |= types_1.KeyModifierValues.alt;
|
|
if (modifiers.shift)
|
|
result |= types_1.KeyModifierValues.shift;
|
|
if (modifiers.meta)
|
|
result |= types_1.KeyModifierValues.meta;
|
|
return result;
|
|
}
|
|
exports.calculateKeyModifiersValue = calculateKeyModifiersValue;
|
|
function calculateMouseButtonValue(options) {
|
|
if (!options.button)
|
|
return 'left';
|
|
return 'right';
|
|
}
|
|
exports.calculateMouseButtonValue = calculateMouseButtonValue;
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcHJveHlsZXNzL2NsaWVudC91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxtQ0FBMEQ7QUFJMUQsU0FBZ0IsMEJBQTBCLENBQUUsU0FBdUI7SUFDL0QsSUFBSSxNQUFNLEdBQUcsQ0FBQyxDQUFDO0lBRWYsSUFBSSxTQUFTLENBQUMsSUFBSTtRQUNkLE1BQU0sSUFBSSx5QkFBaUIsQ0FBQyxJQUFJLENBQUM7SUFDckMsSUFBSSxTQUFTLENBQUMsR0FBRztRQUNiLE1BQU0sSUFBSSx5QkFBaUIsQ0FBQyxHQUFHLENBQUM7SUFDcEMsSUFBSSxTQUFTLENBQUMsS0FBSztRQUNmLE1BQU0sSUFBSSx5QkFBaUIsQ0FBQyxLQUFLLENBQUM7SUFDdEMsSUFBSSxTQUFTLENBQUMsSUFBSTtRQ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