Skip to content

Commit d06a464

Browse files
Scene editor: in webview listen metaKey as ctrlKey.
1 parent de7fc99 commit d06a464

File tree

3 files changed

+21
-27
lines changed

3 files changed

+21
-27
lines changed

source/v2/phasereditor/phasereditor.scene.ui.editor.html/html/Editor.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ namespace PhaserEditor2D {
88

99
const real = input.real_hitTest;
1010
const fake = input.hitTest;
11-
11+
1212
input.hitTest = real;
13-
13+
1414
const result = scene.input.hitTestPointer(pointer);
1515

1616
input.hitTest = fake;
@@ -29,7 +29,6 @@ namespace PhaserEditor2D {
2929
private _pendingMouseDownEvent: MouseEvent;
3030
private _closed = false;
3131
private _isReloading = false;
32-
private _sendKeyData = false;
3332

3433
sceneProperties: any;
3534
selection: any[] = [];
@@ -136,18 +135,16 @@ namespace PhaserEditor2D {
136135
}
137136

138137
sendKeyDown(e: KeyboardEvent) {
139-
if (this._sendKeyData || true) {
140-
const data = {
141-
keyCode: e.keyCode,
142-
ctrlKey: e.ctrlKey,
143-
shiftKey: e.shiftKey,
144-
};
138+
const data = {
139+
keyCode: e.keyCode,
140+
ctrlKey: e.ctrlKey || e.metaKey,
141+
shiftKey: e.shiftKey,
142+
};
145143

146-
this.sendMessage({
147-
method: "KeyDown",
148-
data: data
149-
})
150-
}
144+
this.sendMessage({
145+
method: "KeyDown",
146+
data: data
147+
});
151148
}
152149

153150
private onResize() {

source/v2/phasereditor/phasereditor.scene.ui.editor.html/html/out/Editor.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ var PhaserEditor2D;
44
function Editor() {
55
this._closed = false;
66
this._isReloading = false;
7-
this._sendKeyData = false;
87
this.selection = [];
98
Editor._instance = this;
109
this.openSocket();
@@ -94,17 +93,15 @@ var PhaserEditor2D;
9493
});
9594
};
9695
Editor.prototype.sendKeyDown = function (e) {
97-
if (this._sendKeyData || true) {
98-
var data = {
99-
keyCode: e.keyCode,
100-
ctrlKey: e.ctrlKey,
101-
shiftKey: e.shiftKey
102-
};
103-
this.sendMessage({
104-
method: "KeyDown",
105-
data: data
106-
});
107-
}
96+
var data = {
97+
keyCode: e.keyCode,
98+
ctrlKey: e.ctrlKey || e.metaKey,
99+
shiftKey: e.shiftKey
100+
};
101+
this.sendMessage({
102+
method: "KeyDown",
103+
data: data
104+
});
108105
};
109106
Editor.prototype.onResize = function () {
110107
for (var _i = 0, _a = this._game.scene.scenes; _i < _a.length; _i++) {

source/v2/phasereditor/phasereditor.scene.ui.editor/src/phasereditor/scene/ui/editor/properties/WebViewSection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public Control createContent(Composite parent) {
5959
{
6060
var btn = new Button(comp, SWT.PUSH);
6161
btn.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
62-
btn.setText("System Browser - pepe");
62+
btn.setText("System Browser");
6363
btn.setImage(EditorSharedImages.getImage(IMG_WORLD));
6464
btn.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
6565
WebRunUI.openBrowser(getEditor().getBroker().getUrl());

0 commit comments

Comments
 (0)