with the operating system so that you can customize the operations for various
shortcuts.
-Note that the shortcut is global; it will work even if the app does
+**Note**: The shortcut is global; it will work even if the app does
not have the keyboard focus. You should not use this module until the `ready`
event of the app module is emitted.
* `accelerator` [Accelerator](accelerator.md)
-Returns `true` or `false` depending on whether the shortcut `accelerator` is registered.
+Returns `true` or `false` depending on whether the shortcut `accelerator` is
+registered.
### `globalShortcut.unregister(accelerator)`
# ipc (main process)
-The `ipc` module, when used in the main process, handles asynchronous and synchronous messages sent from a renderer process (web page). Messages sent from a renderer will be emitted to this module.
+The `ipc` module, when used in the main process, handles asynchronous and
+synchronous messages sent from a renderer process (web page). Messages sent from
+a renderer will be emitted to this module.
## Sending Messages
- When sending a message, the event name is the `channel`.
- To reply a synchronous message, you need to set `event.returnValue`.
-- To send an asynchronous back to the sender, you can use `event.sender.send(...)`.
+- To send an asynchronous back to the sender, you can use
+ `event.sender.send(...)`.
An example of sending and handling messages between the render and main
processes:
ipc.send('asynchronous-message', 'ping');
```
-## Methods
+## Listening for Messages
-The `ipc` module has the following method:
+The `ipc` module has the following method to listen for events:
### `ipc.on(channel, callback)`
The `ipc` module provides a few methods so you can send synchronous and
asynchronous messages from the render process (web page) to the main process.
-You can also receive messages returned from the main process.
+You can also receive replies from the main process.
**Note**: If you want to make use of modules in the main process from the renderer
process, you might consider using the [remote](remote.md) module.