diff --git a/packages/core/src/api.ts b/packages/core/src/api.ts index 21d0ca9..3f63d2f 100644 --- a/packages/core/src/api.ts +++ b/packages/core/src/api.ts @@ -23,7 +23,7 @@ export interface AnalogStates { // trackpad?: {x: number, y: number, z: number}[] // z: proximity/force } export interface JoystickValue { - /** Joystick X (horisontal movement). -127 to 127 */ + /** Joystick X (horizontal movement). -127 to 127 */ x: number /** Joystick Y (vertical movement), positive value is "up". -127 to 127 */ y: number @@ -34,7 +34,7 @@ export interface JoystickValue { z: number } export interface TrackballValue { - /** X (delta horisontal movement). 2 byte */ + /** X (delta horizontal movement). 2 byte */ x: number /** Y (delta vertical movement), positive value is "up". 2 byte */ y: number diff --git a/packages/core/src/products.ts b/packages/core/src/products.ts index 1610088..dde46a4 100644 --- a/packages/core/src/products.ts +++ b/packages/core/src/products.ts @@ -52,7 +52,7 @@ export interface Product { trackYbyte_H: number // the index of the high byte of 2 byte Y position }[] - /** If the X-keys panel has special buttons or digital inputs that do not map to the standand matrix. */ + /** If the X-keys panel has special buttons or digital inputs that do not map to the standard matrix. */ hasExtraButtons?: { ebByte: number // the index of the byte to find the extra button ebBit: number // the index of the bit in that byte @@ -359,7 +359,7 @@ export const PRODUCTS: { [name: string]: Product } = { ], }), XK60: literal({ - name: 'XK-60', // the USB hardwware string will report "xkeys 80 HID" because it uses the same firmware as 80, the PID tells the difference + name: 'XK-60', // the USB hardware string will report "xkeys 80 HID" because it uses the same firmware as 80, the PID tells the difference hidDevices: [ [1121, 0], [1123, 0], @@ -594,7 +594,7 @@ export const PRODUCTS: { [name: string]: Product } = { hasGPIO: true, timestampByte: 31, // ms time since device boot 4 byte BE //The input data will always be in the 2 data bytes described, but this device may be configured in several ways - // it is best to Qwery the device and get its current setup data, using GetIoConfiguration function + // it is best to Query the device and get its current setup data, using GetIoConfiguration function }), XCRS232: literal({ name: 'XC-RS232-DB9', // DB9 connector for RS232 and six 3.5 mm ports, contacts for a stereo Plug @@ -669,7 +669,7 @@ export const PRODUCTS: { [name: string]: Product } = { [2, 4], [1, 4], ], - //Sends DMX512 Data to DMX512 devivces on the , see documentation + //Sends DMX512 Data to DMX512 devices on the , see documentation }), XK16LCD: literal({ @@ -882,7 +882,7 @@ export const PRODUCTS: { [name: string]: Product } = { }), XBK_QWERTY: literal({ //new product, expected release Q1 2023 - name: 'X-blox XBK-QWERTY Module', // Typing Keyboard module with up to 32 columns & RGB backLight LEDs, basic module has only 16 columns, extra satilite boards add extra columns, see documentation + name: 'X-blox XBK-QWERTY Module', // Typing Keyboard module with up to 32 columns & RGB backLight LEDs, basic module has only 16 columns, extra satellite boards add extra columns, see documentation hidDevices: [ [1343, 0], [1344, 0], diff --git a/packages/core/src/xkeys.ts b/packages/core/src/xkeys.ts index c9bb730..94eccc7 100644 --- a/packages/core/src/xkeys.ts +++ b/packages/core/src/xkeys.ts @@ -466,7 +466,7 @@ export class XKeys extends EventEmitter { if (bankIndex !== undefined) { this._write([0, 165, ledIndex, bankIndex, color.r, color.g, color.b, flashing ? 1 : 0]) } else { - // There are 2 leds in under a key, 0 for top and 1 for bottom. + // There are 2 LEDs in under a key, 0 for top and 1 for bottom. this._write([0, 165, ledIndex, 0, color.r, color.g, color.b, flashing ? 1 : 0]) this._write([0, 165, ledIndex, 1, color.r, color.g, color.b, flashing ? 1 : 0]) } @@ -515,7 +515,7 @@ export class XKeys extends EventEmitter { if (bankIndex !== undefined) { this._write([0, 166, bankIndex, color.r, color.g, color.b]) } else { - // There are 2 leds in under a key, 0 for top and 1 for bottom. + // There are 2 LEDs in under a key, 0 for top and 1 for bottom. this._write([0, 166, 0, color.r, color.g, color.b]) this._write([0, 166, 1, color.r, color.g, color.b]) } @@ -535,7 +535,7 @@ export class XKeys extends EventEmitter { this._write([0, 184]) } /** - * Sets the backlightintensity of the device + * Sets the backlight intensity of the device * @param blueIntensity 0-255 * @param redIntensity 0-255 */ @@ -608,12 +608,12 @@ export class XKeys extends EventEmitter { public writeLcdDisplay(line: number, displayChar: string, backlight: boolean): void { this.ensureInitialized() if (!this.product.hasLCD) return // only used for LCD display devices. - const byteVals = [0, 206, 0, 1, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32] // load the array with 206 op code and spaces + const byteValues = [0, 206, 0, 1, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32] // load the array with 206 op code and spaces // change line number to 0 or 1 and set line # byte if (line < 2) line = 0 if (line > 1) line = 1 - byteVals[2] = line + byteValues[2] = line // change backlight to 0 or 1 and set backlight byte let liteByte if (backlight) { @@ -621,15 +621,15 @@ export class XKeys extends EventEmitter { } else { liteByte = 0 } - byteVals[3] = liteByte // set the LCD backlight on or off. + byteValues[3] = liteByte // set the LCD backlight on or off. // loop through the string and load array with ascii byte values let i for (i = 0; i < displayChar.length; i++) { - byteVals[i + 4] = displayChar.charCodeAt(i) + byteValues[i + 4] = displayChar.charCodeAt(i) if (i > 15) break // quit at 16 chars } - this._write(byteVals) + this._write(byteValues) } /** @@ -714,11 +714,11 @@ export class XKeys extends EventEmitter { let location: { row: number; col: number } = { row: 0, col: 0 } // derive the Row and Column from the button index for many products if (keyIndex !== 0) { - // program switch is always on index 0 and always R:0, C:0 unless remapped by btnLocaion array + // program switch is always on index 0 and always R:0, C:0 unless remapped by btnLocation array location.row = keyIndex - this.product.bBits * (Math.ceil(keyIndex / this.product.bBits) - 1) location.col = Math.ceil(keyIndex / this.product.bBits) } - // if the product has a btnLocaion array, then look up the Row and Column + // if the product has a btnLocation array, then look up the Row and Column if (this.product.btnLocation !== undefined) { location = { row: this.product.btnLocation[keyIndex][0],