Skip to content

Commit 28274a8

Browse files
committed
v0.73.6
1 parent 987c6b1 commit 28274a8

File tree

4 files changed

+758
-654
lines changed

4 files changed

+758
-654
lines changed

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "emulators-ui",
3-
"version": "0.73.5",
3+
"version": "0.73.6",
44
"description": "Emulators UI",
55
"main": "dist/emulators-ui.js",
66
"types": "dist/types/emulators-ui.d.ts",
@@ -30,26 +30,26 @@
3030
},
3131
"homepage": "https://js-dos.com",
3232
"devDependencies": {
33-
"@babel/core": "^7.18.2",
34-
"@babel/preset-env": "^7.18.2",
33+
"@babel/core": "^7.18.6",
34+
"@babel/preset-env": "^7.18.6",
3535
"@types/browserify": "^12.0.36",
3636
"@types/gulp": "^4.0.6",
3737
"@types/gulp-rename": "2.0.1",
3838
"@types/gulp-size": "^4.0.0",
3939
"@types/gulp-sourcemaps": "0.0.35",
4040
"@types/gulp-terser": "^1.2.1",
41-
"@types/node": "^17.0.38",
41+
"@types/node": "^18.0.3",
4242
"@types/vinyl-buffer": "^1.0.0",
4343
"@types/vinyl-source-stream": "0.0.30",
44-
"@typescript-eslint/eslint-plugin": "^5.27.0",
45-
"@typescript-eslint/parser": "^5.27.0",
44+
"@typescript-eslint/eslint-plugin": "^5.30.5",
45+
"@typescript-eslint/parser": "^5.30.5",
4646
"babelify": "^10.0.0",
4747
"browserify": "^17.0.0",
48-
"core-js": "^3.22.8",
48+
"core-js": "^3.23.4",
4949
"del": "^6.1.1",
5050
"element-resize-detector": "^1.2.4",
51-
"emulators": "^0.73.6",
52-
"eslint": "^8.16.0",
51+
"emulators": "^0.73.7",
52+
"eslint": "^8.19.0",
5353
"eslint-config-google": "^0.14.0",
5454
"git-repo-info": "^2.1.1",
5555
"gulp": "^4.0.2",
@@ -60,10 +60,10 @@
6060
"md5.js": "^1.3.5",
6161
"nipplejs": "^0.9.0",
6262
"notyf": "^3.10.0",
63-
"simple-keyboard": "^2.32.48",
64-
"ts-node": "^10.8.0",
63+
"simple-keyboard": "^3.4.122",
64+
"ts-node": "^10.8.2",
6565
"tsify": "^5.0.4",
66-
"typescript": "^4.7.2",
66+
"typescript": "^4.7.4",
6767
"vinyl-buffer": "^1.0.1",
6868
"vinyl-source-stream": "^2.0.0"
6969
}

src/build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
export const Build = {
77
short: "0.73.5",
8-
version: "0.73.5 (30edf4d38a4cb6b03e735ccab8f0ab95)",
9-
buildSeed: 1654243824812,
8+
version: "0.73.5 (2823574dcca80b00ce959e6882126e16)",
9+
buildSeed: 1657520884756,
1010
};

src/dom/layers.ts

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { createDiv, stopPropagation } from "./helpers";
66
import { domToKeyCode, KBD_enter, KBD_leftshift,
77
KBD_backspace, KBD_capslock, KBD_tab, KBD_space, KBD_esc,
88
KBD_leftctrl, KBD_leftalt, KBD_comma, KBD_period, KBD_quote,
9-
KBD_semicolon, KBD_leftbracket, KBD_rightbracket,
9+
KBD_semicolon, KBD_leftbracket, KBD_rightbracket, KBD_up, KBD_down, KBD_left, KBD_right,
1010
} from "./keys";
1111
/* eslint-enable camelcase */
1212

@@ -304,23 +304,39 @@ export class Layers {
304304

305305
const layout = {
306306
en: [
307-
"{esc} ` 1 2 3 4 5 6 7 8 9 0 - = {bksp}",
308-
"q w e r t y u i o p { } \\",
309-
"a s d f g h j k l ; ' [ {enter}",
310-
"⎘ z x c v b n m , . / ] {space}",
307+
"{esc} ` 1 2 3 4 5 6 7 8 9 0 () - = {bksp} {enter}",
308+
"{tab} q w e r t y u i o p { } \\ {up}",
309+
"{shift} {left} {right} a s d f g h j k l ; ' [ {down}",
310+
"⎘ {alt} {ctrl} z x c v b n m , . / ] {space}",
311311
],
312312
};
313313
const enLayoutDisplay = {
314-
"{esc}": "ESC",
315-
"{bksp}": "Backspace",
316-
"{enter}": "",
314+
"{esc}": "",
315+
"{bksp}": "",
316+
"{enter}": "",
317317
"{space}": "Space",
318+
"{up}": "↑",
319+
"{down}": "↓",
320+
"{left}": "←",
321+
"{right}": "→",
322+
"{shift}": "⇑",
323+
"{ctrl}": "Ctrl",
324+
"{alt}": "Alt",
325+
"{tab}": "Tab",
318326
};
319327
const ruLayoutDisplay = {
320-
"{esc}": "ESC",
321-
"{bksp}": "Backspace",
322-
"{enter}": "",
328+
"{esc}": "",
329+
"{bksp}": "",
330+
"{enter}": "",
323331
"{space}": "Space",
332+
"{up}": "↑",
333+
"{down}": "↓",
334+
"{left}": "←",
335+
"{right}": "→",
336+
"{shift}": "⇑",
337+
"{alt}": "Alt",
338+
"{ctrl}": "Ctrl",
339+
"{tab}": "Tab",
324340
"q": "й", "w": "ц", "e": "у", "r": "к", "t": "е",
325341
"y": "н", "u": "г", "i": "ш", "o": "щ", "p": "з",
326342
"{": "х", "}": "ъ", "a": "ф", "s": "ы", "d": "в",
@@ -337,12 +353,21 @@ export class Layers {
337353
keyboardDiv.style.display = "none";
338354
stopPropagation(keyboardDiv);
339355

340-
341356
const keyboard = new Keyboard(keyboardDiv, {
342357
layout,
343358
layoutName: "en",
344359
display: displayOrder[displayIndex],
345-
onKeyPress: (button) => {
360+
onKeyPress: (button: string) => {
361+
if (button === "⎘") {
362+
return;
363+
}
364+
365+
const keyCodes = buttonToCode(button);
366+
for (const keyCode of keyCodes) {
367+
this.fireKeyDown(keyCode);
368+
}
369+
},
370+
onKeyReleased: (button: string) => {
346371
if (button === "⎘") {
347372
displayIndex = (displayIndex + 1) % displayOrder.length;
348373
keyboard.setOptions({
@@ -352,18 +377,14 @@ export class Layers {
352377
}
353378

354379
const keyCodes = buttonToCode(button);
355-
if (keyCodes.length === 1) {
356-
this.fireKeyPress(keyCodes[0]);
357-
} else if (keyCodes.length > 0) {
358-
this.fireKeysPress(keyCodes);
380+
for (const keyCode of keyCodes) {
381+
this.fireKeyUp(keyCode);
359382
}
360383
},
361384
preventMouseDownDefault: true,
362385
preventMouseUpDefault: true,
363386
stopMouseDownPropagation: true,
364387
stopMouseUpPropagation: true,
365-
autoUseTouchEvents: true,
366-
useMouseEvents: true,
367388
});
368389

369390
this.toggleKeyboard = () => {
@@ -432,10 +453,18 @@ function buttonToCode(button: string): number[] {
432453
return [KBD_space];
433454
} else if (button === "{esc}") {
434455
return [KBD_esc];
435-
} else if (button === "ctrl") {
456+
} else if (button === "{ctrl}") {
436457
return [KBD_leftctrl];
437458
} else if (button === "{alt}") {
438459
return [KBD_leftalt];
460+
} else if (button === "{up}") {
461+
return [KBD_up];
462+
} else if (button === "{down}") {
463+
return [KBD_down];
464+
} else if (button === "{left}") {
465+
return [KBD_left];
466+
} else if (button === "{right}") {
467+
return [KBD_right];
439468
} else {
440469
console.warn("Unknown button", button);
441470
return [];

0 commit comments

Comments
 (0)