Skip to content

Commit

Permalink
removed mobile mouse functionality for now. added instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintSampo committed Dec 16, 2023
1 parent ba2a0bd commit d80646a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
1 change: 0 additions & 1 deletion PestoLink-Mobile/mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ user-select: none;

.interface-container div{
font-size: 1vw;
height: 5vw;
background-color: grey;
border-radius: 1vw;
padding: 1vw;
Expand Down
15 changes: 14 additions & 1 deletion PestoLink-Mobile/mobile.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,20 @@

<div class="interface-container container">
<button id="ButtonBLE">Connect BLE</button>
<div id="debug-info">No info</div>
<!-- <div id="debug-info">No info</div> -->
<div id="instructions">
On Mobile:
<br><br>
use on-screen joystick and buttons for control
<br><br><br>
On Laptops:
<br><br>
move joystick: "wasd" or "ijkl"
<br><br>
buttons: "zxcv" or "nm,."

</div>

</div>

<div id="button-agent" class="button-container container">
Expand Down
10 changes: 5 additions & 5 deletions PestoLink-Mobile/mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ function createJoystick(parent) {
const stick = document.createElement('div');
stick.classList.add('joystick');

stick.addEventListener('mousedown', handleMouseDown);
document.addEventListener('mousemove', handleMouseMove);
document.addEventListener('mouseup', handleMouseUp);
//stick.addEventListener('mousedown', handleMouseDown);
//document.addEventListener('mousemove', handleMouseMove);
//document.addEventListener('mouseup', handleMouseUp);

stick.addEventListener('touchstart', handleTouchDown, { passive: false });
document.addEventListener('touchmove', handleTouchMove, { passive: false });
Expand Down Expand Up @@ -175,9 +175,9 @@ function createButtonAgent() {
];

for (let i = 0; i < buttons.length; i++) {
buttons[i].onmousedown = handleButton.bind(null, i, true);
//buttons[i].onmousedown = handleButton.bind(null, i, true);
buttons[i].ontouchstart = handleButton.bind(null, i, true);
buttons[i].onclick = handleButton.bind(null, i, false);
//buttons[i].onclick = handleButton.bind(null, i, false);
buttons[i].ontouchend = handleButton.bind(null, i, false);
}
document.addEventListener('keydown', handleKeyboardInput);
Expand Down

0 comments on commit d80646a

Please sign in to comment.