index.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Keyboard Shortcuts</title>
  6. </head>
  7. <body>
  8. <div>
  9. <h1>Keyboard Shortcuts</h1>
  10. <h3>The <code>globalShortcut</code> and <code>Menu</code> modules can be used to define keyboard shortcuts.</h3>
  11. <p>
  12. In Electron, keyboard shortcuts are called accelerators.
  13. They can be assigned to actions in your application's Menu,
  14. or they can be assigned globally so they'll be triggered even when
  15. your app doesn't have keyboard focus.
  16. </p>
  17. <p>
  18. Open the full documentation for the
  19. <a href="https://electronjs.org/docs/api/menu">Menu</a>,
  20. <a href="https://electronjs.org/docs/api/accelerator">Accelerator</a>,
  21. and
  22. <a href="https://electronjs.org/docs/api/global-shortcut">globalShortcut</a>
  23. APIs in your browser.
  24. </p>
  25. </div>
  26. <div>
  27. <div>
  28. <div>
  29. <p>
  30. To try this demo, press <kbd>CommandOrControl+Alt+K</kbd> on your
  31. keyboard.
  32. </p>
  33. <p>
  34. Global shortcuts are detected even when the app doesn't have
  35. keyboard focus, and they must be registered after the app's
  36. `ready` event is emitted.
  37. </p>
  38. <div>
  39. <h2>ProTip</h2>
  40. <strong>Avoid overriding system-wide keyboard shortcuts.</strong>
  41. <p>
  42. When registering global shortcuts, it's important to be aware of
  43. existing defaults in the target operating system, so as not to
  44. override any existing behaviors. For an overview of each
  45. operating system's keyboard shortcuts, view these documents:
  46. </p>
  47. <ul>
  48. <li><a
  49. href="https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/OSXHIGuidelines/Keyboard.html">macOS</a>
  50. </li>
  51. <li><a
  52. href="http://windows.microsoft.com/en-us/windows-10/keyboard-shortcuts">Windows</a></li>
  53. <li><a
  54. href="https://developer.gnome.org/hig/stable/keyboard-input.html.en">Linux</a></li>
  55. </ul>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </body>
  61. </html>