Skip to content

Commit

Permalink
Pass Uint8Arrays to TraktorS3.incomingData
Browse files Browse the repository at this point in the history
As suggested in
#11199 (comment). The
function does accept both typed arrays and plain arrays.
  • Loading branch information
robbert-vdh committed Mar 14, 2023
1 parent ce70fa0 commit 93fa58a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions res/controllers/Traktor-Kontrol-S3-hid-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ TraktorS3.Controller = class {
// with different values once. Report 2 contains the state of the mixer
// controls.
const report2Values = new Uint8Array(controller.getInputReport(2));
TraktorS3.incomingData([2, ...Array.from(report2Values.map(x => ~x))]);
TraktorS3.incomingData([2, ...Array.from(report2Values)]);
TraktorS3.incomingData(new Uint8Array([2, ...Uint8Array.from(report2Values.map(x => ~x))]));
TraktorS3.incomingData(new Uint8Array([2, ...Uint8Array.from(report2Values)]));

// Report 1 is the state of the deck controls. These shouldn't have any
// initial effect, and most of these values will be 0 anyways. We'll
Expand Down

0 comments on commit 93fa58a

Please sign in to comment.