Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/chore/spelling'
Browse files Browse the repository at this point in the history
  • Loading branch information
nytamin committed Jan 11, 2024
2 parents b00d271 + 221430f commit b552fd9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -359,7 +359,7 @@ export const PRODUCTS: { [name: string]: Product } = {
],
}),
XK60: literal<Product>({
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],
Expand Down Expand Up @@ -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<Product>({
name: 'XC-RS232-DB9', // DB9 connector for RS232 and six 3.5 mm ports, contacts for a stereo Plug
Expand Down Expand Up @@ -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<Product>({
Expand Down Expand Up @@ -882,7 +882,7 @@ export const PRODUCTS: { [name: string]: Product } = {
}),
XBK_QWERTY: literal<Product>({
//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],
Expand Down
20 changes: 10 additions & 10 deletions packages/core/src/xkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
Expand Down Expand Up @@ -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])
}
Expand All @@ -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
*/
Expand Down Expand Up @@ -608,28 +608,28 @@ 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) {
liteByte = 1
} 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)
}

/**
Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit b552fd9

Please sign in to comment.