You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shortcut: "F4",// also supported: Ctrl+Shift+Z, Ctrl+Y
286
+
...shortcut("F4"),// also supported: Ctrl+Shift+Z, Ctrl+Y
287
287
speech_recognition: [
288
288
"repeat","redo",
289
289
],
@@ -293,7 +293,7 @@ const menus = {
293
293
},
294
294
{
295
295
label: localize("&History"),
296
-
shortcut: "Ctrl+Shift+Y",
296
+
...shortcut("Ctrl+Shift+Y"),
297
297
speech_recognition: [
298
298
"show history","history",
299
299
],
@@ -303,7 +303,7 @@ const menus = {
303
303
MENU_DIVIDER,
304
304
{
305
305
label: localize("Cu&t"),
306
-
shortcut: "Ctrl+X",
306
+
...shortcut("Ctrl+X"),
307
307
speech_recognition: [
308
308
"cut","cut selection","cut selection to clipboard","cut the selection","cut the selection to clipboard","cut the selection to the clipboard",
309
309
],
@@ -317,7 +317,7 @@ const menus = {
317
317
},
318
318
{
319
319
label: localize("&Copy"),
320
-
shortcut: "Ctrl+C",
320
+
...shortcut("Ctrl+C"),
321
321
speech_recognition: [
322
322
"copy","copy selection","copy selection to clipboard","copy the selection","copy the selection to clipboard","copy the selection to the clipboard",
323
323
],
@@ -331,7 +331,7 @@ const menus = {
331
331
},
332
332
{
333
333
label: localize("&Paste"),
334
-
shortcut: "Ctrl+V",
334
+
...shortcut("Ctrl+V"),
335
335
speech_recognition: [
336
336
"paste","paste from clipboard","paste from the clipboard","insert clipboard","insert clipboard contents","insert the contents of the clipboard","paste what's on the clipboard",
"select the whole image","select the whole picture","select the whole drawing","select the whole canvas","select the whole document",
@@ -390,7 +390,7 @@ const menus = {
390
390
[localize("&View")]: [
391
391
{
392
392
label: localize("&Tool Box"),
393
-
shortcut: window.is_electron_app ? "Ctrl+T" : "",// Ctrl+T opens a new browser tab, Ctrl+Alt+T opens a Terminal in Ubuntu, and Ctrl+Shift+Alt+T feels silly.
393
+
...shortcut(window.is_electron_app ? "Ctrl+T" : ""),// Ctrl+T opens a new browser tab, Ctrl+Alt+T opens a Terminal in Ubuntu, and Ctrl+Shift+Alt+T feels silly.
shortcut: "Ctrl+L",// focuses browser address bar, but Firefox and Chrome both allow overriding the default behavior
408
+
...shortcut("Ctrl+L"),// focuses browser address bar, but Firefox and Chrome both allow overriding the default behavior
409
409
speech_recognition: [
410
410
"toggle color box","toggle colors box","toggle palette","toggle color palette","toggle colors palette",
411
411
// @TODO: hide/show
@@ -455,7 +455,7 @@ const menus = {
455
455
submenu: [
456
456
{
457
457
label: localize("&Normal Size"),
458
-
shortcut: window.is_electron_app ? "Ctrl+PgUp" : "",// Ctrl+PageUp cycles thru browser tabs in Chrome & Firefox; can be overridden in Chrome in fullscreen only
458
+
...shortcut(window.is_electron_app ? "Ctrl+PgUp" : ""),// Ctrl+PageUp cycles thru browser tabs in Chrome & Firefox; can be overridden in Chrome in fullscreen only
459
459
speech_recognition: [
460
460
"reset zoom","zoom to normal size",
461
461
"zoom to 100%","set zoom to 100%","set zoom 100%",
@@ -471,7 +471,7 @@ const menus = {
471
471
},
472
472
{
473
473
label: localize("&Large Size"),
474
-
shortcut: window.is_electron_app ? "Ctrl+PgDn" : "",// Ctrl+PageDown cycles thru browser tabs in Chrome & Firefox; can be overridden in Chrome in fullscreen only
474
+
...shortcut(window.is_electron_app ? "Ctrl+PgDn" : ""),// Ctrl+PageDown cycles thru browser tabs in Chrome & Firefox; can be overridden in Chrome in fullscreen only
475
475
speech_recognition: [
476
476
"zoom to large size",
477
477
"zoom to 400%","set zoom to 400%","set zoom 400%",
...shortcut("F11"),// relies on browser's shortcut
580
580
speech_recognition: [
581
581
// won't work with speech recognition, needs a user gesture
582
582
],
@@ -603,7 +603,7 @@ const menus = {
603
603
// @TODO: speech recognition: terms that apply to selection
604
604
{
605
605
label: localize("&Flip/Rotate"),
606
-
shortcut: (window.is_electron_app&&!window.electron_is_dev) ? "Ctrl+R" : "Ctrl+Alt+R",// Ctrl+R reloads the browser tab (or Electron window in dev mode via electron-debug)
606
+
...shortcut((window.is_electron_app&&!window.electron_is_dev) ? "Ctrl+R" : "Ctrl+Alt+R"),// Ctrl+R reloads the browser tab (or Electron window in dev mode via electron-debug)
// This is a duplicate menu item (for easy access), so it doesn't need speech recognition data here.
794
794
],
@@ -798,7 +798,7 @@ const menus = {
798
798
{
799
799
emoji_icon: "🎞️",
800
800
label: localize("&Render History As GIF"),
801
-
shortcut: "Ctrl+Shift+G",
801
+
...shortcut("Ctrl+Shift+G"),
802
802
speech_recognition: [
803
803
// @TODO: animated gif, blah
804
804
"render history as gif","render history as a gif","render history animation","make history animation","make animation of history","make animation of document history","make animation from document history",
@@ -1392,3 +1392,115 @@ for (const [top_level_menu_key, menu] of Object.entries(menus)) {
1392
1392
1393
1393
export{menus};
1394
1394
1395
+
/**
1396
+
* Expands a shortcut label into an object with the label and a corresponding ARIA key shortcuts value.
1397
+
* Could handle "CtrlOrCmd" like Electron does, here, or just treat "Ctrl" as control or command.
1398
+
* Of course it would be more ergonomic if OS-GUI.js handled this sort of thing,
1399
+
* and I have thought about rewriting the OS-GUI API to mimic Electron's.
1400
+
* I also have some munging logic in electron-main.js related to this.
0 commit comments