-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from olzzon/develop
Overlay and Wipe fix and improvements
- Loading branch information
Showing
10 changed files
with
105 additions
and
58 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
class HandleShortcuts { | ||
constructor(ccgLoadPlay) { | ||
this.ccgLoadPlay = ccgLoadPlay; | ||
const unsubscribe = store.subscribe(() => { | ||
this.store = window.store.getState(); | ||
}); | ||
//Setup Keyboard shortcuts: | ||
document.addEventListener("keydown", this._handleKeyDown.bind(this)); | ||
} | ||
|
||
//Shortcut for mix and take | ||
_handleKeyDown(event) { | ||
//Corresponding output for QWER shortcut: | ||
const keyTuple = {Q: 1, W: 2, E: 3, R: 4}; | ||
|
||
//Only Allow Active Tab to shortcut: | ||
//key: 1-4 | ||
const pvwPlay = JSON.stringify(this.store.appNavReducer[0].appNav.activeTab+1).charCodeAt(0); | ||
//key: QWER: | ||
const pgmPlay = ["Q", "W", "E", "R"][this.store.appNavReducer[0].appNav.activeTab].charCodeAt(0); | ||
|
||
switch( event.keyCode ) { | ||
case pvwPlay: | ||
this.ccgLoadPlay.pvwPlay(parseInt(String.fromCharCode(event.keyCode))); | ||
break; | ||
case pgmPlay: | ||
console.log("Play output : ", keyTuple[String.fromCharCode(event.keyCode)]); | ||
this.ccgLoadPlay.pgmPlay(keyTuple[String.fromCharCode(event.keyCode)]); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
} | ||
|
||
export default HandleShortcuts; |