# hyperterm-register-shortcut

> Register user-configurable global shortcuts for HyperTerm which respect config changes

Latest version **1.3.0** (published 2017-08-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install hyperterm-register-shortcut
pnpm add hyperterm-register-shortcut
yarn add hyperterm-register-shortcut
bun add hyperterm-register-shortcut
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2017-08-19 |
| First published | 2016-07-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | John Soutar |
| Maintainers | dcalhoun, soutar |
| Keywords | hyperterm, shortcut, hotkey, helper |

## Links

- npm: https://www.npmjs.com/package/hyperterm-register-shortcut
- Repository: https://github.com/Soutar/hyperterm-register-shortcut
- Homepage: https://github.com/Soutar/hyperterm-register-shortcut#readme
- Issues: https://github.com/Soutar/hyperterm-register-shortcut/issues
- npm.io page: https://npm.io/package/hyperterm-register-shortcut

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2017-08-19
- 1.2.0 — 2017-04-15
- 1.1.0 — 2017-04-15
- 1.0.1 — 2016-07-28
- 1.0.0 — 2016-07-28

## README

# hyperterm-register-shortcut [![Build Status](https://travis-ci.org/soutar/hyperterm-register-shortcut.svg?branch=master)](https://travis-ci.org/soutar/hyperterm-register-shortcut)
Register user-customisable global shortcuts for HyperTerm which respect config changes. This module is designed to be used by HyperTerm plugins to implement global shortcuts and can't be installed as a plugin itself.

For the configKey `foo`, `hyperterm-register-shortcut` will look for the user's preferred hotkey in following order:
- `config.hotkeys.foo`
- `config.foo.hotkey`
- `config.fooShortcut`

## Usage

First, import the helper from `hyperterm-register-shortcut`

```js
const registerShortcut = require('hyperterm-register-shortcut');
```

Then use registerShortcut to create an `onApp` method to export:

```js
const configKey = 'YOUR_SHORTCUT_NAME';
const defaultShortcut = 'Ctrl+;';

function foo (app) {
  // do something with app
  console.log('bar');
}

module.exports = {
  onApp: registerShortcut(configKey, foo, defaultShortcut)
}
```
Or, if you have other work you need to do inside `onApp`, export your own function which calls `registerShortcut` then calls the function returned from it with `app` as the parameter

```js
const configKey = 'YOUR_SHORTCUT_NAME';

function foo () {
  // do something with app
  console.log('bar');
}

module.exports = {
  onApp: (app) => {
    // do some other onApp stuff first
    registerShortcut(configKey, foo)(app)
  }
}
```

---
_Source: https://npm.io/package/hyperterm-register-shortcut · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
