➕ Add 'keyevent.json' dependency
This commit is contained in:
parent
6a8d56433f
commit
3f94331977
3 changed files with 10 additions and 3 deletions
7
main.js
7
main.js
|
@ -3,6 +3,7 @@ import { exec } from 'node:child_process';
|
||||||
import { overrideConsole } from 'nodejs-better-console';
|
import { overrideConsole } from 'nodejs-better-console';
|
||||||
import Eris from 'eris';
|
import Eris from 'eris';
|
||||||
import { Command } from 'commander';
|
import { Command } from 'commander';
|
||||||
|
import KeyEvent from 'keyevent.json' assert { type: 'json' };
|
||||||
import { parse } from 'shell-quote';
|
import { parse } from 'shell-quote';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -53,15 +54,15 @@ const
|
||||||
program
|
program
|
||||||
.command('p')
|
.command('p')
|
||||||
.description('Play/pause media')
|
.description('Play/pause media')
|
||||||
.action(() => adb('input keyevent 85'));
|
.action(() => adb(`input keyevent ${KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE}`));
|
||||||
program
|
program
|
||||||
.command('play')
|
.command('play')
|
||||||
.description('Play media')
|
.description('Play media')
|
||||||
.action(() => adb('input keyevent 126'));
|
.action(() => adb(`input keyevent ${KeyEvent.KEYCODE_MEDIA_PLAY}`));
|
||||||
program
|
program
|
||||||
.command('pause')
|
.command('pause')
|
||||||
.description('Pause media')
|
.description('Pause media')
|
||||||
.action(() => adb('input keyevent 127'));
|
.action(() => adb(`input keyevent ${KeyEvent.KEYCODE_MEDIA_PAUSE}`));
|
||||||
program
|
program
|
||||||
.command('spotify')
|
.command('spotify')
|
||||||
.description('Launch Spotify')
|
.description('Launch Spotify')
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"commander": "^11.1.0",
|
"commander": "^11.1.0",
|
||||||
"eris": "^0.17.1",
|
"eris": "^0.17.1",
|
||||||
|
"keyevent.json": "^0.1.0",
|
||||||
"nodejs-better-console": "^1.0.2",
|
"nodejs-better-console": "^1.0.2",
|
||||||
"shell-quote": "^1.8.1"
|
"shell-quote": "^1.8.1"
|
||||||
},
|
},
|
||||||
|
|
|
@ -17,6 +17,11 @@ eris@^0.17.1:
|
||||||
opusscript "^0.0.8"
|
opusscript "^0.0.8"
|
||||||
tweetnacl "^1.0.3"
|
tweetnacl "^1.0.3"
|
||||||
|
|
||||||
|
keyevent.json@^0.1.0:
|
||||||
|
version "0.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/keyevent.json/-/keyevent.json-0.1.0.tgz#598ef46218f53350ac4c5ce845dcaadcf2b6f2bb"
|
||||||
|
integrity sha512-1SVBT4dTNggvKXOk8etHiMngBTfo2RaRwcNSugx94IvYNr2Yhlypoq/eerQyPY79+Ew4PyxLnKw2duRHx9n1Kw==
|
||||||
|
|
||||||
nodejs-better-console@^1.0.2:
|
nodejs-better-console@^1.0.2:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/nodejs-better-console/-/nodejs-better-console-1.0.2.tgz#bf6da52a3bf6ddbc61a414b1d83739c86117f207"
|
resolved "https://registry.yarnpkg.com/nodejs-better-console/-/nodejs-better-console-1.0.2.tgz#bf6da52a3bf6ddbc61a414b1d83739c86117f207"
|
||||||
|
|
Loading…
Reference in a new issue