Browse code

default to other keyboard layout

devnewton authored on 09/03/2018 16:59:01
Showing 2 changed files
... ...
@@ -22,16 +22,16 @@ export class KeyboardOptions extends AbstractState {
22 22
         logo.anchor.setTo(0.5, 0);
23 23
 
24 24
         const menu = new Menu(this.game);
25
-        menu.button("Azerty zsqd hjk", 200, 100, () => {
26
-            (<UnderthiefGame>this.game).controllers.getKeyboard().useAzertyLayout();
25
+        menu.button("⬆⬇⬅➡ shift ctrl", 200, 300, () => {
26
+            (<UnderthiefGame>this.game).controllers.getKeyboard().useOtherKeyboardLayout();
27 27
             this.game.state.start('Options');
28 28
         });
29
-        menu.button("Qwerty wsad hjk", 200, 200, () => {
30
-            (<UnderthiefGame>this.game).controllers.getKeyboard().useQwertyLayout();
29
+        menu.button("Azerty zsqd jk", 200, 100, () => {
30
+            (<UnderthiefGame>this.game).controllers.getKeyboard().useAzertyLayout();
31 31
             this.game.state.start('Options');
32 32
         });
33
-        menu.button("Others ⬆⬇⬅➡ ⎇␣⎈", 200, 300, () => {
34
-            (<UnderthiefGame>this.game).controllers.getKeyboard().useOtherKeyboardLayout();
33
+        menu.button("Qwerty wsad jk", 200, 200, () => {
34
+            (<UnderthiefGame>this.game).controllers.getKeyboard().useQwertyLayout();
35 35
             this.game.state.start('Options');
36 36
         });
37 37
         menu.button("Custom", 200, 400, () => {
... ...
@@ -124,14 +124,14 @@ export class KeyboardControls extends AbstractControls {
124 124
     setupKeyboardLayout() {
125 125
         this.kb = this.game.input.keyboard;
126 126
         let layout = localStorage.getItem('keyboard.layout');
127
-        if (null == layout || layout == 'azerty') {
127
+        if (layout == 'azerty') {
128 128
             this.useAzertyLayout();
129 129
         } else if (layout == 'qwerty') {
130 130
             this.useQwertyLayout();
131
-        } else if (layout == 'other') {
132
-            this.useOtherKeyboardLayout();
133 131
         } else if (layout == 'custom') {
134 132
             this.useCustomKeyboardLayout();
133
+        } else {
134
+            this.useOtherKeyboardLayout();
135 135
         }
136 136
     }
137 137
 
... ...
@@ -162,8 +162,8 @@ export class KeyboardControls extends AbstractControls {
162 162
         this.keyCodeMoveDown = Phaser.KeyCode.DOWN;
163 163
         this.keyCodeMoveLeft = Phaser.KeyCode.LEFT;
164 164
         this.keyCodeMoveRight = Phaser.KeyCode.RIGHT;
165
-        this.keyCodeHammerTime = Phaser.KeyCode.ALT;
166
-        this.keyCodeDash = Phaser.KeyCode.SHIFT;
165
+        this.keyCodeHammerTime = Phaser.KeyCode.SHIFT;
166
+        this.keyCodeDash = Phaser.KeyCode.CONTROL;
167 167
         this.keyCodeMenu = Phaser.KeyCode.ESC;
168 168
         localStorage.setItem('keyboard.layout', 'other');
169 169
     }
... ...
@@ -173,7 +173,7 @@ export class KeyboardControls extends AbstractControls {
173 173
         this.keyCodeMoveDown = this.readNumberFromLocalStorage('keyboard.layout.custom.moveDown', Phaser.KeyCode.DOWN);
174 174
         this.keyCodeMoveLeft = this.readNumberFromLocalStorage('keyboard.layout.custom.moveLeft', Phaser.KeyCode.LEFT);
175 175
         this.keyCodeMoveRight = this.readNumberFromLocalStorage('keyboard.layout.custom.moveRight', Phaser.KeyCode.RIGHT);
176
-        this.keyCodeHammerTime = this.readNumberFromLocalStorage('keyboard.layout.custom.hammer', Phaser.KeyCode.ALT);
176
+        this.keyCodeHammerTime = this.readNumberFromLocalStorage('keyboard.layout.custom.hammer', Phaser.KeyCode.SHIFT);
177 177
         this.keyCodeDash = this.readNumberFromLocalStorage('keyboard.layout.custom.dash', Phaser.KeyCode.CONTROL);
178 178
         this.keyCodeMenu = this.readNumberFromLocalStorage('keyboard.layout.custom.menu', Phaser.KeyCode.ESC);
179 179
         localStorage.setItem('keyboard.layout', 'custom');