Ks89/angular-modal-gallery

View on GitHub
projects/ks89/angular-modal-gallery/src/lib/utils/user-input.util.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
/*
 The MIT License (MIT)

 Copyright (c) 2017-2024 Stefano Cappa (Ks89)

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in all
 copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 */

/**
 * Key of the keyboard's key `enter`
 */
export const ENTER_KEY: string = 'Enter';
/**
 * Code of the keyboard's key `enter`
 */
export const ENTER_CODE: string = 'Enter';

/**
 * Key of the keyboard's key `esc`
 */
export const ESC_KEY: string = 'Escape';
/**
 * Code of the keyboard's key `esc`
 */
export const ESC_CODE: string = 'Escape';
/**
 * Key of the keyboard's key 'right arrow'
 */
export const RIGHT_ARROW_KEY: string = 'ArrowRight';
/**
 * Code of the keyboard's key 'right arrow'
 */
export const RIGHT_ARROW_CODE: string = 'ArrowRight';
/**
 * Key of the keyboard's key 'left arrow'
 */
export const LEFT_ARROW_KEY: string = 'ArrowLeft';
/**
 * Code of the keyboard's key 'left arrow'
 */
export const LEFT_ARROW_CODE: string = 'ArrowLeft';
/**
 * Key of the keyboard's key 'left arrow'
 */
export const UP_ARROW_KEY: string = 'ArrowUp';
/**
 * Code of the keyboard's key 'left arrow'
 */
export const UP_ARROW_CODE: string = 'ArrowUp';
/**
 * Key of the keyboard's key 'left arrow'
 */
export const DOWN_ARROW_KEY: string = 'ArrowDown';
/**
 * Code of the keyboard's key 'left arrow'
 */
export const DOWN_ARROW_CODE: string = 'ArrowDown';
/**
 * Key of the keyboard's key `space`
 */
export const SPACE_KEY : string= '';
/**
 * Code of the keyboard's key `space`
 */
export const SPACE_CODE: string = 'Space';

/**
 * Const to represent the right direction
 */
export const DIRECTION_RIGHT: string = 'right';
/**
 * Const to represent the left direction
 */
export const DIRECTION_LEFT: string = 'left';


/**
 * Keycode of the main mouse button
 */
export const MOUSE_MAIN_BUTTON_CLICK = 0;

/**
 * Const NEXT
 */
export const NEXT = 1;
/**
 * Const PREV
 */
export const PREV = -1;
/**
 * Const NOTHING to represents a situation when it isn't both NEXT and PREV
 */
export const NOTHING = 0;