Skip to content

Commit

Permalink
window focus patch
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintSampo committed Dec 14, 2024
1 parent c7520e6 commit b815f09
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<button id="ble-status">not connected</button>

<div id="settings-grid">

<div class="settings-label">Mobile Layout</div>

<div class="settings-toggle">
Expand Down
11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,16 @@ function renderLoop() {
}
}

if (!document.hasFocus()) { rawPacket.fill(0, 0, 20); }
if (!document.hasFocus()) {
rawPacket.fill(0, 0, 20);
rawPacket[0] = 1;
rawPacket[1] = 127;
rawPacket[2] = 127;
rawPacket[3] = 127;
rawPacket[4] = 127;
}

//console.log(rawPacket)
console.log(rawPacket)
bleAgent.attemptSend(rawPacket);
}

Expand Down
2 changes: 0 additions & 2 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ body {
}

#info-container {
display: none;
box-sizing: border-box;
background: grey;
width: 84vw;
Expand Down Expand Up @@ -84,7 +83,6 @@ body {
#desktop-button {
width: 30vw;
height: 30vw;
display: none;
}

#mobile-joystick {
Expand Down

0 comments on commit b815f09

Please sign in to comment.