Skip to content

Commit

Permalink
fix(FEC-7642): firefox speed selector keyboard shortcut doesnt work (#…
Browse files Browse the repository at this point in the history
…368)

different key code in firefox for semi colon
  • Loading branch information
Yuvalke committed Mar 19, 2019
1 parent 809b384 commit ce9d3b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ui-manager.js
Expand Up @@ -7,6 +7,7 @@ import {copyDeep} from './utils/copy-deep';
import {mergeDeep} from './utils/merge-deep';
import {LogLevel, getLogLevel, setLogLevel} from './utils/logger';
import {EventType} from './event/event-type';
import {setEnv} from './utils/key-map';

import reducer from './store';
import en_translations from './translations/en.json';
Expand Down Expand Up @@ -53,6 +54,7 @@ class UIManager {
this._createStore(config);
this.setConfig(config);
this._setLocaleTranslations(config);
setEnv(this.player.env);
}

/**
Expand Down
9 changes: 9 additions & 0 deletions src/utils/key-map.js
Expand Up @@ -18,6 +18,15 @@ export const KeyMap: {[key: string]: number} = {
PERIOD: 190
};

/**
* set env for keymap
* @param {Object} env - env object
* @returns {void}
*/
export function setEnv(env: Object): void {
KeyMap.SEMI_COLON = env.browser.name.toLowerCase() === 'firefox' ? 59 : 186;
}

/**
* gets the key name for a certain key code
* @param {number} keyCode - key code
Expand Down

0 comments on commit ce9d3b8

Please sign in to comment.