diff --git a/README.md b/README.md index 514ad68e..b4acb15b 100644 --- a/README.md +++ b/README.md @@ -279,6 +279,24 @@ By default dosbox mouse will follow browser cursor without locking. It means tha }); ``` +### Fullscreen + +JsDos provides very basic support for entering fullscreen mode. You can request to enter +fullscreen mode using [CommandInterface.fullscreen()](https://js-dos.com/6.22/docs/api/generate.html?page=js-dos-ci). + +```js + + +``` + +**NOTE:** This function can be called anywhere, but for web security reasons its associated request can only be raised inside the event handler for a user-generated event (for example a key, mouse or touch press/release). + ### Multiple dosbox instances on one page JsDos already support multiple instances, just create new canvas for each jsdos and diff --git a/dist/docs/api/js-dos-ts/js-dos-build.md b/dist/docs/api/js-dos-ts/js-dos-build.md index e900d12a..5acccecd 100644 --- a/dist/docs/api/js-dos-ts/js-dos-build.md +++ b/dist/docs/api/js-dos-ts/js-dos-build.md @@ -20,8 +20,8 @@ gulpfile.js --> generateBuildInfo ``` export const Build = { - version: "6.22.36 (ae0ccc95b30d8b671c0fd81d1997a695)", - jsVersion: "e458350f35a2c3a331959275d81894133a4cdcf5", + version: "6.22.37 (2b23342d2ba488bb3653b8506b7e2667)", + jsVersion: "353e9136ae42c6641ab325375f89ac2f17245287", jsSize: 199660, wasmVersion: "eb83536935802be3c617c911dfce7e28", wasmSize: 1809140, diff --git a/dist/docs/api/js-dos-ts/js-dos-ci.md b/dist/docs/api/js-dos-ts/js-dos-ci.md index 39cecd59..06775ec6 100644 --- a/dist/docs/api/js-dos-ts/js-dos-ci.md +++ b/dist/docs/api/js-dos-ts/js-dos-ci.md @@ -77,6 +77,27 @@ export class DosCommandInterface { +* `fullscreen()` - enters fullscreen mode +This function can be called anywhere, but for web security reasons its associated request can only be raised +inside the event handler for a user-generated event (for example a key, mouse or touch press/release). + + + + +``` + public fullscreen() { + this.dos.canvas.requestFullscreen() + } + + +``` + + + + + + + * `shell([cmd1, cmd2, ...])` - executes passed commands in dosbox shell if it's runned, returns Promise that resolves when commands sequence is executed diff --git a/js-dos-ts/js-dos-build.ts b/js-dos-ts/js-dos-build.ts index 55263168..d47014ac 100644 --- a/js-dos-ts/js-dos-build.ts +++ b/js-dos-ts/js-dos-build.ts @@ -3,8 +3,8 @@ // gulpfile.js --> generateBuildInfo export const Build = { - version: "6.22.36 (ae0ccc95b30d8b671c0fd81d1997a695)", - jsVersion: "e458350f35a2c3a331959275d81894133a4cdcf5", + version: "6.22.37 (2b23342d2ba488bb3653b8506b7e2667)", + jsVersion: "353e9136ae42c6641ab325375f89ac2f17245287", jsSize: 199660, wasmVersion: "eb83536935802be3c617c911dfce7e28", wasmSize: 1809140, diff --git a/js-dos-ts/js-dos-ci.ts b/js-dos-ts/js-dos-ci.ts index 51a76c91..d8d17000 100644 --- a/js-dos-ts/js-dos-ci.ts +++ b/js-dos-ts/js-dos-ci.ts @@ -31,6 +31,13 @@ export class DosCommandInterface { return this.dos.canvas.height; } + // * `fullscreen()` - enters fullscreen mode + // This function can be called anywhere, but for web security reasons its associated request can only be raised + // inside the event handler for a user-generated event (for example a key, mouse or touch press/release). + public fullscreen() { + this.dos.canvas.requestFullscreen() + } + // * `shell([cmd1, cmd2, ...])` - executes passed commands // in dosbox shell if it's runned, returns Promise that // resolves when commands sequence is executed diff --git a/package.json b/package.json index 05872673..8d757713 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "js-dos", - "version": "6.22.36", + "version": "6.22.37", "description": "Easiest API to run dos programs in browser", "main": "dist/js-dos.js", "types": "dist/typescript/js-dos.ts", diff --git a/test/index.html b/test/index.html index 4eb9fd3a..d48fed3c 100644 --- a/test/index.html +++ b/test/index.html @@ -16,7 +16,8 @@