Enhancing add-on compatibility

This commit is contained in:
Francisco Hodge
2018-10-30 23:28:23 -04:00
parent 3bd4fb58b7
commit d567b3ac01
4 changed files with 97 additions and 27 deletions
+11 -2
View File
@@ -11,13 +11,22 @@ class PhysicalKeyboard {
*/
this.simpleKeyboardInstance = simpleKeyboardInstance;
/**
* Bindings
*/
this.initKeyboardListener = this.initKeyboardListener.bind(this);
this.getSimpleKeyboardLayoutKey = this.getSimpleKeyboardLayoutKey.bind(this);
/**
* Initialize key listeners
*/
this.initKeyboardListener();
}
/**
* Initializes key event listeners
*/
initKeyboardListener = () => {
initKeyboardListener(){
// Adding button style on keydown
document.addEventListener("keydown", (event) => {
if(this.simpleKeyboardInstance.options.physicalKeyboardHighlight){
@@ -54,7 +63,7 @@ class PhysicalKeyboard {
* Transforms a KeyboardEvent's "key.code" string into a simple-keyboard layout format
* @param {object} event The KeyboardEvent
*/
getSimpleKeyboardLayoutKey = (event) => {
getSimpleKeyboardLayoutKey(event){
let output;
if(