Skip to content

Instantly share code, notes, and snippets.

@slashinfty
Last active July 11, 2022 14:46
Show Gist options
  • Save slashinfty/f122d5f5430037c4b6347e0a3daee8f8 to your computer and use it in GitHub Desktop.
Save slashinfty/f122d5f5430037c4b6347e0a3daee8f8 to your computer and use it in GitHub Desktop.

A quick way to identify what to input for hotkeys.

  • Create hotkeys.js
  • Input the following:
const readline = require('node:readline');
const readlinePromises = require('node:readline/promises');

const rl = readlinePromises.createInterface({
    input: process.stdin,
    output: process.stdout
});

readline.emitKeypressEvents(rl.input);
rl.input.setRawMode(true);

rl.input.on('keypress', async (str, key) => console.log(key));
  • Run the script with node hotkeys.js
  • Look at the name field that is logged when you press keys, and use that in config.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment