Commit fdfb03b7 authored by Skye's avatar Skye

feat: send schedule info api

parent 55ef423c
import { Jensen as Jen } from "./src/jensen";
import { Logger } from "./src/utils/utils";
import { Jensen as Jen } from './src/jensen';
import { Logger } from './src/utils/utils';
export type DeviceInfo = {
sn: string;
......@@ -8,7 +8,7 @@ export type DeviceInfo = {
};
export type ReturnStruct = {
common: { result: "failed" | "success" };
common: { result: 'failed' | 'success' };
};
export type FileInfo = {
......@@ -24,10 +24,8 @@ export type FileInfo = {
export type ScheduleInfo = {
startDate: Date;
endDate: Date;
keyAnswer?: string;
keyHangup?: string;
keyReject?: string;
keyMicMute?: string;
os: 'Windows' | 'Linux' | 'Mac';
platform: string;
};
declare class JensenType {
......@@ -39,33 +37,20 @@ declare class JensenType {
getDeviceInfo: (time?: number) => Promise<DeviceInfo>;
listFiles: (time?: number) => Promise<FileInfo[]>;
tryconnect: (disableOnConnect?: boolean) => Promise<boolean>;
getFile: (
fileName: string,
length: number,
on?: (msg: Uint8Array | "fail") => void,
onprogress?: (size: number) => void,
) => void;
getFileBlock: (
fileName: string,
length: number,
on?: (msg: Uint8Array | "fail") => void,
) => Promise<ReturnStruct["common"]>;
getFile: (fileName: string, length: number, on?: (msg: Uint8Array | 'fail') => void, onprogress?: (size: number) => void) => void;
getFileBlock: (fileName: string, length: number, on?: (msg: Uint8Array | 'fail') => void) => Promise<ReturnStruct['common']>;
requestFirmwareUpgrade: (
vn: number,
length: number,
time?: number,
time?: number
) => Promise<{
result: "accepted" | "fail";
result: 'accepted' | 'fail';
}>;
beginBNC: (time?: number) => Promise<ReturnStruct["common"]>;
endBNC: (time?: number) => Promise<ReturnStruct["common"]>;
setTime: (date: Date, timeout?: number) => Promise<ReturnStruct["common"]>;
beginBNC: (time?: number) => Promise<ReturnStruct['common']>;
endBNC: (time?: number) => Promise<ReturnStruct['common']>;
setTime: (date: Date, timeout?: number) => Promise<ReturnStruct['common']>;
deleteFile: (fileName: string) => Promise<{ result: string }>;
uploadFirmware: (
data: number[],
seconds?: number,
onProgress?: (cur: number, total: number) => void,
) => Promise<ReturnStruct["common"]>;
uploadFirmware: (data: number[], seconds?: number, onProgress?: (cur: number, total: number) => void) => Promise<ReturnStruct['common']>;
getTime: (time?: number) => Promise<{
time: string;
}>;
......@@ -74,19 +59,10 @@ declare class JensenType {
autoPlay: boolean;
notification?: boolean;
} | null>;
setAutoRecord: (
enable: boolean,
time?: number,
) => Promise<ReturnStruct["common"]>;
setAutoPlay: (
enable: boolean,
time?: number,
) => Promise<ReturnStruct["common"]>;
setAutoRecord: (enable: boolean, time?: number) => Promise<ReturnStruct['common']>;
setAutoPlay: (enable: boolean, time?: number) => Promise<ReturnStruct['common']>;
isConnected: () => boolean;
setNotification: (
state: boolean,
time?: number,
) => Promise<ReturnStruct["common"]>;
setNotification: (state: boolean, time?: number) => Promise<ReturnStruct['common']>;
ondisconnect?: Function;
isStopConnectionCheck: boolean;
getRecordingFile: () => Promise<{
......@@ -94,29 +70,18 @@ declare class JensenType {
createTime: string;
createDate: string;
}>;
getCardInfo: (
seconds?: number,
) => Promise<{ used: number; capacity: number; status: string }>;
formatCard: (seconds?: number) => Promise<ReturnStruct["common"]>;
factoryReset: (seconds?: number) => Promise<ReturnStruct["common"]>;
restoreFactorySettings: (seconds?: number) => Promise<ReturnStruct["common"]>;
getCardInfo: (seconds?: number) => Promise<{ used: number; capacity: number; status: string }>;
formatCard: (seconds?: number) => Promise<ReturnStruct['common']>;
factoryReset: (seconds?: number) => Promise<ReturnStruct['common']>;
restoreFactorySettings: (seconds?: number) => Promise<ReturnStruct['common']>;
getModel: () => string;
getFileCount: (seconds?: number) => Promise<{ count: number } | null>;
recordTestStart: (
type: number,
seconds?: number,
) => Promise<ReturnStruct["common"]>;
recordTestEnd: (
type: number,
seconds?: number,
) => Promise<ReturnStruct["common"]>;
test: (seconds?: number) => Promise<ReturnStruct["common"]>;
setBluetoothPromptPlay: (
state: boolean,
seconds?: number,
) => Promise<ReturnStruct["common"]>;
writeSerialNumber: (sn: string) => Promise<ReturnStruct["common"]>;
sendScheduleInfo: (info: ScheduleInfo) => Promise<ReturnStruct["common"]>;
recordTestStart: (type: number, seconds?: number) => Promise<ReturnStruct['common']>;
recordTestEnd: (type: number, seconds?: number) => Promise<ReturnStruct['common']>;
test: (seconds?: number) => Promise<ReturnStruct['common']>;
setBluetoothPromptPlay: (state: boolean, seconds?: number) => Promise<ReturnStruct['common']>;
writeSerialNumber: (sn: string) => Promise<ReturnStruct['common']>;
sendScheduleInfo: (info: ScheduleInfo) => Promise<ReturnStruct['common']>;
}
//@ts-ignore
......
{
"name": "jensen",
"version": "1.1.3",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "jensen",
"version": "1.1.3",
"version": "1.0.0",
"license": "ISC",
"devDependencies": {
"prettier": "^3.3.3"
......
import { Logger, Logger as internalLogger, getTimeStr } from './utils/utils';
import { Logger, Logger as internalLogger, getTimeStr, shortcutKeys } from './utils/utils';
const QUERY_DEVICE_INFO = 0x01;
const QUERY_DEVICE_TIME = 0x02;
......@@ -25,7 +25,6 @@ const TEST_SN_WRITE = 0xf007;
const RECORD_TEST_START = 0xf008; // 录音测试开始
const RECORD_TEST_END = 0xf009; // 录音测试结束
const COMMAND_NAMES = [
'invalid-0',
'get-device-info',
......@@ -46,13 +45,11 @@ const COMMAND_NAMES = [
'get-settings',
'set-settings',
'get file block',
'factory reset',
'factory reset'
];
function Jensen(log) {
const Logger = log || internalLogger
const Logger = log || internalLogger;
let device = null;
let actions = {};
let buffer = [];
......@@ -131,7 +128,7 @@ function Jensen(log) {
if (r) return;
let conn = await navigator.usb.requestDevice({
filters: [{ vendorId: 0x10d6 }],
filters: [{ vendorId: 0x10d6 }]
});
await conn.open();
self.model = conn.productId == 45069 ? 'hidock-h1e' : 'hidock-h1';
......@@ -179,8 +176,7 @@ function Jensen(log) {
Logger.info('jensen', 'disconnect', 'disconnect');
try {
await device?.close();
} catch (e) {
}
} catch (e) {}
};
this.send = function (cmd, seconds, onprogress) {
......@@ -257,7 +253,7 @@ function Jensen(log) {
tag: tag,
resolve: resolve,
reject: reject,
timeout: t,
timeout: t
};
});
};
......@@ -319,8 +315,7 @@ function Jensen(log) {
if (self.onreceive) {
try {
self.onreceive(totalBytes);
} catch (e) {
}
} catch (e) {}
} else {
// if (self.decodeTimeout) clearTimeout(self.decodeTimeout);
// self.decodeTimeout = setTimeout(function () {
......@@ -345,7 +340,7 @@ function Jensen(log) {
sendNext();
const msg = result.message;
return result && msg.id === TRANSFER_FILE ? msg.body : null;
}
};
const tryDecode = function () {
// 一个容器,比单独任意一个小包要大一点儿,好像还差一点儿
......@@ -388,14 +383,7 @@ function Jensen(log) {
Logger.debug(
'jensen',
'receive',
'recv: ' +
cname +
', seq: ' +
msg.sequence +
', data bytes: ' +
msg.body?.byteLength +
', data: ' +
heading.join(' '),
'recv: ' + cname + ', seq: ' + msg.sequence + ', data bytes: ' + msg.body?.byteLength + ', data: ' + heading.join(' ')
);
try {
let handler = Jensen.handlers[msg.id];
......@@ -403,11 +391,7 @@ function Jensen(log) {
if (r) trigger(r, msg.id);
} catch (e) {
trigger(e);
Logger.error(
'jensen',
'receive',
'recv: ' + COMMAND_NAMES[msg.id] + ', seq: ' + msg.sequence + ', error: ' + String(e),
);
Logger.error('jensen', 'receive', 'recv: ' + COMMAND_NAMES[msg.id] + ', seq: ' + msg.sequence + ', error: ' + String(e));
}
sendNext();
}
......@@ -451,14 +435,14 @@ function Jensen(log) {
dataView[startIndex + idx + 0],
dataView[startIndex + idx + 1],
dataView[startIndex + idx + 2],
dataView[startIndex + idx + 3],
dataView[startIndex + idx + 3]
);
idx += 4;
let len = read_int(
dataView[startIndex + idx + 0],
dataView[startIndex + idx + 1],
dataView[startIndex + idx + 2],
dataView[startIndex + idx + 3],
dataView[startIndex + idx + 3]
);
let padding = (len >> 24) & 0xff;
len = len & 0xffffff;
......@@ -621,7 +605,7 @@ Jensen.prototype.listFiles = async function () {
let fnpad = function (v) {
return v > 9 ? v : '0' + v;
};
for (let i = start; i < data.length;) {
for (let i = start; i < data.length; ) {
let len = 0;
let fname = [];
......@@ -674,7 +658,7 @@ Jensen.prototype.listFiles = async function () {
time: ftime,
duration: duration,
length: flen,
signature: sign.join(''),
signature: sign.join('')
});
}
// if (fcount == -1 && (fc))
......@@ -731,7 +715,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
let audio = document.getElementById('test_audio');
if (!audio) {
audio = document.createElement('audio');
audio.id = 'test_audio'
audio.id = 'test_audio';
audio.src = 'https://audionotes.hidock.com/test/test.aac';
audio.loop = true;
audio.controls = false;
......@@ -774,10 +758,10 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
if (msg != null) {
flen += msg.body.length || msg.body.byteLength;
ondata(msg.body);
Logger.info('jensen', 'getFile length', `${length} ${flen}`)
Logger.info('jensen', 'getFile length', `${length} ${flen}`);
if (flen >= length) {
document.removeEventListener('visibilitychange', visibilitychange);
Logger.info('jensen', 'getFile', 'file download finish.')
Logger.info('jensen', 'getFile', 'file download finish.');
clearEventAndTask();
// return OK indicates all file blocks received
return 'OK';
......@@ -785,7 +769,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
} else {
document.removeEventListener('visibilitychange', visibilitychange);
clearEventAndTask();
Logger.info('jensen', 'getFile', 'file download fail.')
Logger.info('jensen', 'getFile', 'file download fail.');
ondata('fail');
}
};
......@@ -833,7 +817,7 @@ Jensen.prototype.setAutoRecord = function (enable, seconds) {
};
Jensen.prototype.setAutoPlay = function (enable, seconds) {
if (this.versionNumber < 327714) return { result: false };
return this.send(new Command(SET_SETTINGS).body([0, 0, 0, 0, 0, 0, 0, enable ? 1 : 2,]), seconds);
return this.send(new Command(SET_SETTINGS).body([0, 0, 0, 0, 0, 0, 0, enable ? 1 : 2]), seconds);
};
Jensen.prototype.setNotification = function (enable, seconds) {
if (this.versionNumber < 327714) return { result: false };
......@@ -842,10 +826,10 @@ Jensen.prototype.setNotification = function (enable, seconds) {
Jensen.prototype.setBluetoothPromptPlay = function (enable, seconds) {
// h1e 6.1.4 393476
// h1 5.1.4 327940
if (this.model === 'hidock-h1e' && this.versionNumber < 393476) return { result: false }
if (this.model === 'hidock-h1' && this.versionNumber < 327940) return { result: false }
if (this.model === 'hidock-h1e' && this.versionNumber < 393476) return { result: false };
if (this.model === 'hidock-h1' && this.versionNumber < 327940) return { result: false };
return this.send(new Command(SET_SETTINGS).body([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, enable ? 2 : 1]), seconds);
}
};
Jensen.prototype.getCardInfo = function (seconds) {
if (this.versionNumber < 327733) return null;
......@@ -872,7 +856,7 @@ Jensen.prototype.test = async function (seconds) {
};
Jensen.prototype.getFileBlock = async function (filename, length, ondata) {
if (typeof (length) != 'number') throw new Error('parameter `length` required');
if (typeof length != 'number') throw new Error('parameter `length` required');
if (length <= 0) throw new Error('parameter `length` must greater than zero');
if (this.fileLength > 0) return null;
......@@ -888,7 +872,7 @@ Jensen.prototype.getFileBlock = async function (filename, length, ondata) {
this.fileReadBytes = 0;
return this.send(new Command(GET_FILE_BLOCK).body(data));
}
};
Jensen.prototype.writeSerialNumber = async function (sn) {
let data = [];
......@@ -896,23 +880,28 @@ Jensen.prototype.writeSerialNumber = async function (sn) {
data.push(sn.charCodeAt(i));
}
return this.send(new Command(TEST_SN_WRITE).body(data));
}
};
const commonMessageParser = (msg) => {
return { result: msg.body[0] === 0x00 ? 'success' : 'failed' };
};
Jensen.prototype.sendScheduleInfo = function (info) {
const startDate = this.to_bcd(getTimeStr(info.startDate));
const endDate = this.to_bcd(getTimeStr(info.endDate));
const keyAnswer = [3, 7, 4, 0, 0, 0, 0, 0];
const keyHangup = [3, 7, 5, 0, 0, 0, 0, 0];
const keyReject = [3, 7, 6, 0, 0, 0, 0, 0];
const keyMicMute = [3, 7, 7, 0, 0, 0, 0, 0];
const body = [...startDate, ...endDate, 0, 0, ...keyAnswer, ...keyHangup, ...keyReject, ...keyMicMute];
let codes = new Array(33).fill(0);
if (shortcutKeys[info.platform] && shortcutKeys[info.platform][info.os]) {
codes = shortcutKeys[info.platform][info.os];
}
let startDate = new Array(7).fill(0);
let endDate = new Array(7).fill(0);
if (info.startDate && info.endDate) {
startDate = this.to_bcd(getTimeStr(info.startDate));
endDate = this.to_bcd(getTimeStr(info.endDate));
}
const reserved = 0x00; // 预留
const body = [...startDate, ...endDate, 0x00, ...codes];
console.log('send schedule info', info, body);
return this.send(new Command(SCHEDULE_INFO).body(body));
};
};
Jensen.registerHandler(SET_DEVICE_TIME, commonMessageParser);
Jensen.registerHandler(BNC_DEMO_TEST, commonMessageParser);
......@@ -945,7 +934,7 @@ Jensen.registerHandler(QUERY_DEVICE_INFO, (msg, jensen) => {
return {
versionCode: vc.join('.'),
versionNumber: vn,
sn: sn,
sn: sn
};
});
Jensen.registerHandler(QUERY_DEVICE_TIME, (msg, jensen) => {
......@@ -956,10 +945,10 @@ Jensen.registerHandler(QUERY_DEVICE_TIME, (msg, jensen) => {
msg.body[3] & 0xff,
msg.body[4] & 0xff,
msg.body[5] & 0xff,
msg.body[6] & 0xff,
msg.body[6] & 0xff
);
return {
time: time === '00000000000000' ? 'unknown' : time.replace(/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/gi, '$1-$2-$3 $4:$5:$6'),
time: time === '00000000000000' ? 'unknown' : time.replace(/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/gi, '$1-$2-$3 $4:$5:$6')
};
});
Jensen.registerHandler(QUERY_FILE_COUNT, (msg) => {
......@@ -1042,7 +1031,7 @@ Jensen.registerHandler(GET_RECORDING_FILE, (msg) => {
time: ftime,
duration: 0,
length: 0,
signature: '0'.repeat(32),
signature: '0'.repeat(32)
};
}
});
......@@ -1050,8 +1039,7 @@ Jensen.registerHandler(RECORD_TEST_START, commonMessageParser);
Jensen.registerHandler(RECORD_TEST_END, commonMessageParser);
Jensen.registerHandler(DEVICE_MSG_TEST, commonMessageParser);
Jensen.registerHandler(GET_FILE_BLOCK, commonMessageParser);
Jensen.registerHandler(TEST_SN_WRITE, commonMessageParser)
Jensen.registerHandler(SCHEDULE_INFO, commonMessageParser)
Jensen.registerHandler(TEST_SN_WRITE, commonMessageParser);
Jensen.registerHandler(SCHEDULE_INFO, commonMessageParser);
export { Jensen };
const Level = {
debug: "debug",
info: "info",
error: "error",
debug: 'debug',
info: 'info',
error: 'error'
};
export const Logger = {
......@@ -22,7 +22,7 @@ export const Logger = {
module,
procedure,
message: String(message),
time: new Date().getTime(),
time: new Date().getTime()
};
this.messages.push(log);
if (this.consoleOutput) {
......@@ -33,22 +33,20 @@ export const Logger = {
_print(log) {
let time = new Date(log.time);
console.info(
"[" +
(log.level === "error" ? "x" : "*") +
"][" +
'[' +
(log.level === 'error' ? 'x' : '*') +
'][' +
time.toLocaleString() +
"](" +
'](' +
log.module +
" - " +
' - ' +
log.procedure +
") " +
log.message,
') ' +
log.message
);
},
filter(module, procedure) {
return this.messages.filter(
(i) => i.module === module && i.procedure === procedure,
);
return this.messages.filter((i) => i.module === module && i.procedure === procedure);
},
enableConsoleOutput() {
this.consoleOutput = true;
......@@ -71,25 +69,250 @@ export const Logger = {
}
return true;
});
},
}
};
export const getTimeStr = (date: Date) => {
let str =
date.getFullYear() +
"-0" +
'-0' +
(date.getMonth() + 1) +
"-0" +
'-0' +
date.getDate() +
"-0" +
'-0' +
date.getHours() +
"-0" +
'-0' +
date.getMinutes() +
"-0" +
'-0' +
date.getSeconds();
str = str.replace(
/(\d{4})\-0*(\d{2})\-0*(\d{2})\-0*(\d{2})\-0*(\d{2})\-0*(\d{2})/gi,
"$1$2$3$4$5$6",
);
str = str.replace(/(\d{4})\-0*(\d{2})\-0*(\d{2})\-0*(\d{2})\-0*(\d{2})\-0*(\d{2})/gi, '$1$2$3$4$5$6');
return str;
};
const keyMap: { [key: string]: number } = {
A: 0x04,
B: 0x05,
C: 0x06,
D: 0x07,
E: 0x08,
F: 0x09,
G: 0x0a,
H: 0x0b,
I: 0x0c,
J: 0x0d,
K: 0x0e,
L: 0x0f,
M: 0x10,
N: 0x11,
O: 0x12,
P: 0x13,
Q: 0x14,
R: 0x15,
S: 0x16,
T: 0x17,
U: 0x18,
V: 0x19,
W: 0x1a,
X: 0x1b,
Y: 0x1c,
Z: 0x1b,
ENTER: 0x28,
ESCAPE: 0x29,
SPACE: 0x2c
};
const HotKeyBuilder = {
control: false,
shift: false,
alt: false,
guiKey: false,
keys: [],
withControl: () => {
HotKeyBuilder.control = true;
return HotKeyBuilder;
},
withShift: () => {
HotKeyBuilder.shift = true;
return HotKeyBuilder;
},
withAlt: () => {
HotKeyBuilder.alt = true;
return HotKeyBuilder;
},
withGuiKey: () => {
HotKeyBuilder.guiKey = true;
return HotKeyBuilder;
},
withKey: (key: string) => {
if (HotKeyBuilder.keys.length >= 2) throw new Error('exceed max key bindings');
HotKeyBuilder.keys.push(HotKeyBuilder.__mapping(key));
return HotKeyBuilder;
},
__mapping: (key: string) => {
return keyMap[key];
},
build: () => {
let key1 = 0;
if (HotKeyBuilder.control) key1 |= 0x01 << 0;
if (HotKeyBuilder.shift) key1 |= 0x01 << 1;
if (HotKeyBuilder.alt) key1 |= 0x01 << 2;
if (HotKeyBuilder.guiKey) key1 |= 0x01 << 3;
let codes = [
0x03,
key1,
HotKeyBuilder.keys.length ? HotKeyBuilder.keys[0] : 0x00,
HotKeyBuilder.keys.length > 1 ? HotKeyBuilder.keys[1] : 0x00,
0x00,
0x00,
0x00,
0x00
];
HotKeyBuilder.control = false;
HotKeyBuilder.shift = false;
HotKeyBuilder.alt = false;
HotKeyBuilder.guiKey = false;
HotKeyBuilder.keys = [];
return codes;
}
};
const enterKeyCode = (answer: 0 | 1 = 0, hangup: 0 | 1 = 0, reject: 0 | 1 = 0, micMute: 0 | 1 = 0) => {
let code = 0;
if (answer) code |= 0x01 << 0;
if (hangup) code |= 0x01 << 1;
if (reject) code |= 0x01 << 2;
if (micMute) code |= 0x01 << 3;
return code;
};
const emptyCodes = [0, 0, 0, 0, 0, 0, 0, 0];
export const shortcutKeys = {
Zoom: {
Windows: [
enterKeyCode(0, 1),
...emptyCodes,
HotKeyBuilder.withAlt().withKey('Q').build(),
...emptyCodes,
HotKeyBuilder.withAlt().withKey('A').build()
],
Mac: [
enterKeyCode(0, 1),
...emptyCodes,
HotKeyBuilder.withGuiKey().withKey('W').build(),
...emptyCodes,
HotKeyBuilder.withGuiKey().withShift().withKey('A').build()
],
Linux: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, ...emptyCodes]
},
Teams: {
Windows: [
enterKeyCode(),
HotKeyBuilder.withControl().withShift().withKey('A').build(),
HotKeyBuilder.withControl().withShift().withKey('H').build(),
HotKeyBuilder.withControl().withShift().withKey('D').build(),
HotKeyBuilder.withControl().withShift().withKey('M').build()
],
Mac: [
enterKeyCode(),
HotKeyBuilder.withGuiKey().withShift().withKey('A').build(),
HotKeyBuilder.withGuiKey().withShift().withKey('H').build(),
HotKeyBuilder.withGuiKey().withShift().withKey('D').build(),
HotKeyBuilder.withGuiKey().withShift().withKey('M').build()
],
Linux: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, ...emptyCodes]
},
'Google Meetings': {
Windows: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, HotKeyBuilder.withControl().withKey('D').build()],
Mac: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, HotKeyBuilder.withGuiKey().withKey('D').build()],
Linux: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, ...emptyCodes]
},
Webex: {
Windows: [
enterKeyCode(),
HotKeyBuilder.withControl().withShift().withKey('C').build(),
HotKeyBuilder.withControl().withKey('L').build(),
HotKeyBuilder.withControl().withKey('D').build(),
HotKeyBuilder.withControl().withKey('M').build()
],
Mac: [
enterKeyCode(),
HotKeyBuilder.withControl().withShift().withKey('C').build(),
HotKeyBuilder.withGuiKey().withKey('L').build(),
HotKeyBuilder.withGuiKey().withShift().withKey('D').build(),
HotKeyBuilder.withGuiKey().withShift().withKey('M').build()
],
Linux: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, ...emptyCodes]
},
Feishu: {
Windows: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, HotKeyBuilder.withControl().withShift().withKey('D').build()],
Mac: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, HotKeyBuilder.withGuiKey().withShift().withKey('D').build()],
Linux: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, ...emptyCodes]
},
Lark: {
Windows: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, HotKeyBuilder.withControl().withShift().withKey('D').build()],
Mac: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, HotKeyBuilder.withGuiKey().withShift().withKey('D').build()],
Linux: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, ...emptyCodes]
},
WeChat: {
Windows: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, ...emptyCodes],
Mac: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, ...emptyCodes],
Linux: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, ...emptyCodes]
},
Line: {
Windows: [
enterKeyCode(0, 1, 1),
...emptyCodes,
HotKeyBuilder.withKey('ESCAPE').build(),
HotKeyBuilder.withKey('ESCAPE').build(),
HotKeyBuilder.withControl().withShift().withKey('A').build()
],
Mac: [
enterKeyCode(0, 1, 1),
...emptyCodes,
HotKeyBuilder.withKey('ESCAPE').build(),
HotKeyBuilder.withKey('ESCAPE').build(),
HotKeyBuilder.withGuiKey().withShift().withKey('A').build()
],
Linux: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, ...emptyCodes]
},
WhatsApp: {
Windows: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, ...emptyCodes],
Mac: [
enterKeyCode(),
...emptyCodes,
HotKeyBuilder.withGuiKey().withKey('W').build(),
HotKeyBuilder.withGuiKey().withKey('W').build(),
HotKeyBuilder.withGuiKey().withShift().withKey('M').build()
],
Linux: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, ...emptyCodes]
},
Slack: {
Windows: [
enterKeyCode(),
...emptyCodes,
...emptyCodes,
...emptyCodes,
HotKeyBuilder.withControl().withShift().withKey('SPACE').build()
],
Mac: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, HotKeyBuilder.withGuiKey().withShift().withKey('SPACE').build()],
Linux: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, ...emptyCodes]
},
Discord: {
Windows: [
enterKeyCode(),
HotKeyBuilder.withControl().withKey('ENTER').build(),
...emptyCodes,
HotKeyBuilder.withKey('ESCAPE').build(),
HotKeyBuilder.withControl().withShift().withKey('M').build()
],
Mac: [
enterKeyCode(),
HotKeyBuilder.withGuiKey().withKey('ENTER').build(),
...emptyCodes,
HotKeyBuilder.withGuiKey().withKey('ESCAPE').build(),
HotKeyBuilder.withGuiKey().withShift().withKey('M').build()
],
Linux: [enterKeyCode(), ...emptyCodes, ...emptyCodes, ...emptyCodes, ...emptyCodes]
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment