Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update key event strings, replace "underscore" replaced with "dash" #397

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions public/src/bugs/4337 drag destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ function create()

});

this.input.keyboard.once('keydown_A', function () {

circ.destroy();

});

this.input.keyboard.once('keydown-A', function () {

circ.destroy();
Expand Down
6 changes: 3 additions & 3 deletions public/src/display/blend modes/blend mode tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Example extends Phaser.Scene
equationIndex + ' = ' + list2[equationIndex] + ' - ASR'
]);

this.input.keyboard.on('keydown_A', function (event) {
this.input.keyboard.on('keydown-A', function (event) {

equationIndex = 0;
equation = equations[equationIndex];
Expand All @@ -121,7 +121,7 @@ class Example extends Phaser.Scene

});

this.input.keyboard.on('keydown_S', function (event) {
this.input.keyboard.on('keydown-S', function (event) {

equationIndex = 1;
equation = equations[equationIndex];
Expand All @@ -139,7 +139,7 @@ class Example extends Phaser.Scene

});

this.input.keyboard.on('keydown_R', function (event) {
this.input.keyboard.on('keydown-R', function (event) {

equationIndex = 2;
equation = equations[equationIndex];
Expand Down
6 changes: 3 additions & 3 deletions public/src/game objects/container/multi camera input test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Example extends Phaser.Scene
maxSpeed: 1.0
});

this.input.keyboard.on('keydown_SPACE', event =>
this.input.keyboard.on('keydown-SPACE', event =>
{

if (this.current === this.cam1)
Expand Down Expand Up @@ -117,14 +117,14 @@ class Example extends Phaser.Scene

}, this);

this.input.keyboard.on('keydown_Z', event =>
this.input.keyboard.on('keydown-Z', event =>
{

this.controls.camera.rotation += 0.01;

}, this);

this.input.keyboard.on('keydown_X', event =>
this.input.keyboard.on('keydown-X', event =>
{

this.controls.camera.rotation -= 0.01;
Expand Down
14 changes: 7 additions & 7 deletions public/src/game objects/graphics/_wip/single obj viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,32 @@ class Example extends Phaser.Scene

console.log(this.model);

this.input.keyboard.on('keyup_X', () =>
this.input.keyboard.on('keyup-X', () =>
{
this.direction = 0;
});

this.input.keyboard.on('keyup_Y', () =>
this.input.keyboard.on('keyup-Y', () =>
{
this.direction = 1;
});

this.input.keyboard.on('keyup_Z', () =>
this.input.keyboard.on('keyup-Z', () =>
{
this.direction = 2;
});

this.input.keyboard.on('keydown_LEFT', () =>
this.input.keyboard.on('keydown-LEFT', () =>
{
this.rotateX3D(-0.03490658503988659);
});

this.input.keyboard.on('keydown_RIGHT', () =>
this.input.keyboard.on('keydown-RIGHT', () =>
{
this.rotateX3D(0.03490658503988659);
});

this.input.keyboard.on('keydown_UP', () =>
this.input.keyboard.on('keydown-UP', () =>
{

if (this.direction === 0)
Expand All @@ -88,7 +88,7 @@ class Example extends Phaser.Scene

});

this.input.keyboard.on('keydown_DOWN', () =>
this.input.keyboard.on('keydown-DOWN', () =>
{

if (this.direction === 0)
Expand Down
2 changes: 1 addition & 1 deletion public/src/game objects/render texture/draw on texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Example extends Phaser.Scene

let i = 0;

this.input.keyboard.on('keydown_SPACE', () =>
this.input.keyboard.on('keydown-SPACE', () =>
{

rt.clear();
Expand Down
14 changes: 7 additions & 7 deletions public/src/game objects/shapes/iso draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ class Example extends Phaser.Scene



// this.input.keyboard.on('keydown_C', this.setCircle, this);
// this.input.keyboard.on('keydown_R', this.setRectangle, this);
// this.input.keyboard.on('keydown_E', this.setEllipse, this);
// this.input.keyboard.on('keydown_S', this.setStar, this);
// this.input.keyboard.on('keydown_L', this.setLine, this);
// this.input.keyboard.on('keydown_DELETE', this.deleteShape, this);
// this.input.keyboard.on('keydown_TAB', this.changeShape, this);
// this.input.keyboard.on('keydown-C', this.setCircle, this);
// this.input.keyboard.on('keydown-R', this.setRectangle, this);
// this.input.keyboard.on('keydown-E', this.setEllipse, this);
// this.input.keyboard.on('keydown-S', this.setStar, this);
// this.input.keyboard.on('keydown-L', this.setLine, this);
// this.input.keyboard.on('keydown-DELETE', this.deleteShape, this);
// this.input.keyboard.on('keydown-TAB', this.changeShape, this);

this.cursors = this.input.keyboard.createCursorKeys();

Expand Down
8 changes: 4 additions & 4 deletions public/src/game objects/shapes/stacker es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Instructions extends Phaser.Scene {

this.add.text(20, 450, 'Space Bar or Click to Place a Row', { fontFamily: 'bebas', fontSize: 40, color: '#ffffff' }).setShadow(2, 2, "#333333", 2, false, true);

this.input.keyboard.once('keydown_SPACE', this.start, this);
this.input.keyboard.once('keydown-SPACE', this.start, this);
this.input.once('pointerdown', this.start, this);
}

Expand Down Expand Up @@ -167,7 +167,7 @@ class StackerGame extends Phaser.Scene {

this.timer = this.time.addEvent({ delay: this.speed, callback: this.moveBlocks, callbackScope: this, loop: true });

this.input.keyboard.on('keydown_SPACE', this.drop, this);
this.input.keyboard.on('keydown-SPACE', this.drop, this);
this.input.on('pointerdown', this.drop, this);
}

Expand Down Expand Up @@ -466,7 +466,7 @@ class StackerGame extends Phaser.Scene {
{
this.timer.remove(false);

this.input.keyboard.off('keydown_SPACE', this.drop);
this.input.keyboard.off('keydown-SPACE', this.drop);
this.input.off('pointerdown', this.drop);

this.registry.set('score', this.gridHeight - this.currentY);
Expand Down Expand Up @@ -546,7 +546,7 @@ class GameOver extends Phaser.Scene {

this.add.text(400, 500, 'Space or Click to try again', { fontFamily: 'bebas', fontSize: 26, color: '#ffffff' }).setShadow(2, 2, "#333333", 2, false, true).setOrigin(0.5);

this.input.keyboard.once('keydown_SPACE', this.restart, this);
this.input.keyboard.once('keydown-SPACE', this.restart, this);
this.input.once('pointerdown', this.restart, this);
}

Expand Down
2 changes: 1 addition & 1 deletion public/src/game objects/shapes/stacker.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Example extends Phaser.Scene

this.timer = this.time.addEvent({ delay: this.speed, callback: this.moveBlocks, callbackScope: this, loop: true });

this.input.keyboard.on('keydown_SPACE', this.drop, this);
this.input.keyboard.on('keydown-SPACE', this.drop, this);
this.input.on('pointerdown', this.drop, this);
}

Expand Down
8 changes: 4 additions & 4 deletions public/src/games/stacker/stacker.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Instructions extends Phaser.Scene {

this.add.text(20, 450, 'Space Bar or Click to Place a Row', { fontFamily: 'bebas', fontSize: 40, color: '#ffffff' }).setShadow(2, 2, "#333333", 2, false, true);

this.input.keyboard.once('keydown_SPACE', this.start, this);
this.input.keyboard.once('keydown-SPACE', this.start, this);
this.input.once('pointerdown', this.start, this);
}

Expand Down Expand Up @@ -167,7 +167,7 @@ class StackerGame extends Phaser.Scene {

this.timer = this.time.addEvent({ delay: this.speed, callback: this.moveBlocks, callbackScope: this, loop: true });

this.input.keyboard.on('keydown_SPACE', this.drop, this);
this.input.keyboard.on('keydown-SPACE', this.drop, this);
this.input.on('pointerdown', this.drop, this);
}

Expand Down Expand Up @@ -466,7 +466,7 @@ class StackerGame extends Phaser.Scene {
{
this.timer.remove(false);

this.input.keyboard.off('keydown_SPACE', this.drop);
this.input.keyboard.off('keydown-SPACE', this.drop);
this.input.off('pointerdown', this.drop);

this.registry.set('score', this.gridHeight - this.currentY);
Expand Down Expand Up @@ -546,7 +546,7 @@ class GameOver extends Phaser.Scene {

this.add.text(400, 500, 'Space or Click to try again', { fontFamily: 'bebas', fontSize: 26, color: '#ffffff' }).setShadow(2, 2, "#333333", 2, false, true).setOrigin(0.5);

this.input.keyboard.once('keydown_SPACE', this.restart, this);
this.input.keyboard.once('keydown-SPACE', this.restart, this);
this.input.once('pointerdown', this.restart, this);
}

Expand Down
4 changes: 2 additions & 2 deletions public/src/input/camera/graphics contains.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ class Example extends Phaser.Scene

this.controls = (Phaser.Cameras.Controls.Smoothed) ? new Phaser.Cameras.Controls.SmoothedKeyControl(controlConfig) : new Phaser.Cameras.Controls.SmoothedKeyControl(controlConfig);

this.input.keyboard.on('keydown_Z', function (event)
this.input.keyboard.on('keydown-Z', function (event)
{

this.cameras.main.rotation += 0.01;

}, this);

this.input.keyboard.on('keydown_X', function (event)
this.input.keyboard.on('keydown-X', function (event)
{

this.cameras.main.rotation -= 0.01;
Expand Down
6 changes: 3 additions & 3 deletions public/src/input/camera/multi cam sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Example extends Phaser.Scene
maxSpeed: 1.0
});

this.input.keyboard.on('keydown_SPACE', event =>
this.input.keyboard.on('keydown-SPACE', event =>
{

if (this.current === this.cam1)
Expand Down Expand Up @@ -113,14 +113,14 @@ class Example extends Phaser.Scene

}, this);

this.input.keyboard.on('keydown_Z', event =>
this.input.keyboard.on('keydown-Z', event =>
{

this.controls.camera.rotation += 0.01;

}, this);

this.input.keyboard.on('keydown_X', event =>
this.input.keyboard.on('keydown-X', event =>
{

this.controls.camera.rotation -= 0.01;
Expand Down
4 changes: 2 additions & 2 deletions public/src/input/game object/world game objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ class Example extends Phaser.Scene
this.text = this.add.text(100, 200, 'x: 0 y: 0', { font: '18px Courier', fill: '#00ff00' }).setScrollFactor(0);
this.text2 = this.add.text(100, 400, '', { font: '18px Courier', fill: '#00ff00' }).setScrollFactor(0);

this.input.keyboard.on('keydown_Z', function (event)
this.input.keyboard.on('keydown-Z', function (event)
{

this.cameras.main.setRotation(this.cameras.main.rotation + 0.01);

}, this);

this.input.keyboard.on('keydown_X', function (event)
this.input.keyboard.on('keydown-X', function (event)
{

this.cameras.main.setRotation(this.cameras.main.rotation - 0.01);
Expand Down
12 changes: 6 additions & 6 deletions public/src/input/keyboard/cross scene keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class SceneA extends Phaser.Scene {
{
let jelly = this.add.image(150, 500, 'jellies', 'WithShadow/Jelly1').setScale(0.5);
let bubble1 = createSpeechBubble(this, 20, 30, 220, 80, "Scene A\nKey.on").setVisible(false);
let bubble2 = createSpeechBubble(this, 20, 160, 220, 80, "Scene A\nkeydown_SPACE").setVisible(false);
let bubble2 = createSpeechBubble(this, 20, 160, 220, 80, "Scene A\nkeydown-SPACE").setVisible(false);
let bubble3 = createSpeechBubble(this, 20, 290, 220, 80, "Scene A\nkeydown").setVisible(false);

let spaceKey = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);
Expand All @@ -92,7 +92,7 @@ class SceneA extends Phaser.Scene {
// Call stopImmediatePropagation to stop it reaching the global handler in this Scene.
// Call stopPropagation to stop it reaching any other Scene.

this.input.keyboard.on('keydown_SPACE', function (event) {
this.input.keyboard.on('keydown-SPACE', function (event) {

// event.stopPropagation();
// event.stopImmediatePropagation();
Expand Down Expand Up @@ -135,7 +135,7 @@ class SceneB extends Phaser.Scene {
{
let jelly = this.add.image(400, 500, 'jellies', 'WithShadow/Jelly2').setScale(0.5);
let bubble1 = createSpeechBubble(this, 290, 30, 220, 80, "Scene B\nKey.on").setVisible(false);
let bubble2 = createSpeechBubble(this, 290, 160, 220, 80, "Scene B\nkeydown_SPACE").setVisible(false);
let bubble2 = createSpeechBubble(this, 290, 160, 220, 80, "Scene B\nkeydown-SPACE").setVisible(false);
let bubble3 = createSpeechBubble(this, 290, 290, 220, 80, "Scene B\nkeydown").setVisible(false);

let spaceKey = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);
Expand All @@ -159,7 +159,7 @@ class SceneB extends Phaser.Scene {
// Call stopImmediatePropagation to stop it reaching the global handler in this Scene.
// Call stopPropagation to stop it reaching any other Scene.

this.input.keyboard.on('keydown_SPACE', function (event) {
this.input.keyboard.on('keydown-SPACE', function (event) {

// event.stopPropagation();
// event.stopImmediatePropagation();
Expand Down Expand Up @@ -198,7 +198,7 @@ class SceneC extends Phaser.Scene {
{
let jelly = this.add.image(650, 500, 'jellies', 'WithShadow/Jelly3').setScale(0.5);
let bubble1 = createSpeechBubble(this, 560, 30, 220, 80, "Scene C\nKey.on").setVisible(false);
let bubble2 = createSpeechBubble(this, 560, 160, 220, 80, "Scene C\nkeydown_SPACE").setVisible(false);
let bubble2 = createSpeechBubble(this, 560, 160, 220, 80, "Scene C\nkeydown-SPACE").setVisible(false);
let bubble3 = createSpeechBubble(this, 560, 290, 220, 80, "Scene C\nkeydown").setVisible(false);

let spaceKey = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);
Expand All @@ -222,7 +222,7 @@ class SceneC extends Phaser.Scene {
// Call stopImmediatePropagation to stop it reaching the global handler in this Scene.
// Call stopPropagation to stop it reaching any other Scene.

this.input.keyboard.on('keydown_SPACE', function (event) {
this.input.keyboard.on('keydown-SPACE', function (event) {

// event.stopPropagation();
// event.stopImmediatePropagation();
Expand Down
2 changes: 1 addition & 1 deletion public/src/input/keyboard/key modifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Example extends Phaser.Scene
{
create ()
{
this.input.keyboard.on('keydown_A', event =>
this.input.keyboard.on('keydown-A', event =>
{

if (event.ctrlKey)
Expand Down
Loading