小编G. *_*gne的帖子

按"esc"时退出全屏(使用带电子的javascript)

我正在开发一个应用程序(带电子),我希望用户能够在按下"esc"时退出全屏模式.我尝试了不同的方法,徒劳无功.以下是以全屏模式在新浏览器窗口中启动应用程序以及显示和HTML/CSS内容的代码:

    'use strict';

const electron = require('electron');
// Module to control application life.
const app = electron.app;
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow;

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;

function createWindow () {
  // Create the browser window.
  mainWindow = new BrowserWindow({fullscreen:true});

  // and load the index.html of the app.
  mainWindow.loadURL('file://' + __dirname …
Run Code Online (Sandbox Code Playgroud)

javascript escaping fullscreen electron

8
推荐指数
1
解决办法
5725
查看次数

标签 统计

electron ×1

escaping ×1

fullscreen ×1

javascript ×1