Add: ESC key back(), Enter key start/restart to all features
This commit is contained in:
@@ -13,12 +13,18 @@ var TypingTest = {
|
||||
|
||||
game.stage.backgroundColor = '#4d4d4d';
|
||||
|
||||
// keyboard shortcut
|
||||
this.keyboardShortcut = new KeyboardShortcut();
|
||||
this.keyboardShortcut.addCallback(
|
||||
Phaser.KeyCode.ESC, // keyCode
|
||||
null, // keyDownHandler
|
||||
(function() { this.back(); }).bind(this), // keyUpHandler
|
||||
"keyboard_test" // callerClassName
|
||||
);
|
||||
|
||||
// top ui
|
||||
var screenTopUI = new ScreenTopUI();
|
||||
screenTopUI.makeBackButton( function() {
|
||||
sessionStorageManager.resetPlayingAppData();
|
||||
location.href = '../../web/client/menu_typing_test.html';
|
||||
});
|
||||
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
|
||||
screenTopUI.makeFullScreenButton();
|
||||
|
||||
|
||||
@@ -144,6 +150,12 @@ var TypingTest = {
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
back: function() {
|
||||
sessionStorageManager.resetPlayingAppData();
|
||||
location.href = '../../web/client/menu_typing_test.html';
|
||||
},
|
||||
|
||||
startGame: function() {
|
||||
this.averageTypingSpeedText.print(0);
|
||||
|
||||
@@ -311,7 +323,7 @@ var TypingTest = {
|
||||
this.inputTextContent.canvasInput.value('');
|
||||
},
|
||||
|
||||
checkTypingContents: function(evnet) {
|
||||
checkTypingContents: function(event) {
|
||||
if(event.keyCode == Phaser.Keyboard.ENTER) {
|
||||
// console.log("### enter ###");
|
||||
var inputContent = this.inputTextContent.canvasInput.value();
|
||||
|
||||
Reference in New Issue
Block a user