From f196fcdaa2ec5014be524e7026c24940e7c4aaa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Fri, 30 Mar 2018 19:17:42 +0200 Subject: [PATCH] Make switch-keymap.js accept a keymap abbreviation. --- packages/usb/switch-keymap.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/usb/switch-keymap.js b/packages/usb/switch-keymap.js index deb9e5a5..fcc5df0c 100755 --- a/packages/usb/switch-keymap.js +++ b/packages/usb/switch-keymap.js @@ -2,7 +2,14 @@ const uhk = require('./uhk'); (async function() { + const keymapAbbreviation = process.argv[2]; + + if (keymapAbbreviation === undefined) { + console.log('Usage: switch-keymap.js keymapName'); + return; + } + const device = uhk.getUhkDevice(); - const sendData = await uhk.switchKeymap(device, 'TES'); + const sendData = await uhk.switchKeymap(device, keymapAbbreviation); console.log(sendData) })();