This document outlines the structure and types of events transmitted in the event-driven JSON format for gamepad, keyboard, and mouse inputs.
{
"events": [
{"type": "gamepadButton", "button": "A", "state": true},
A | |
Add | |
AudioForward | |
AudioMute | |
AudioNext | |
AudioPause | |
AudioPlay | |
AudioPrev | |
AudioRandom | |
AudioRepeat |
'use client'; | |
/* eslint-disable indent */ | |
import React from "react"; | |
import useWindowSize from "@/hooks/use-spatial-navigation/useWindowSize"; | |
import getScaledSize from "@/hooks/use-spatial-navigation/getScaledSize"; | |
import { useGestureRecognizer } from "use-mediapipe"; | |
import useCamera from "@/hooks/use-spatial-navigation/useCamera"; | |
import { drawHandsWithKeyLandmarks } from "@/hooks/use-spatial-navigation/drawHands"; | |
import { Button } from 'react-daisyui'; |
/** | |
* @license | |
* Copyright 2020 Google LLC. All Rights Reserved. | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* https://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
#include <BleMouse.h> // Include the bleMouse library | |
BleMouse bleMouse; | |
const int joystickXPin = 26; // Pin for the X-axis of the joystick | |
const int joystickYPin = 36; // Pin for the Y-axis of the joystick | |
const int toggleButtonPin = 27; // Pin for the toggle button | |
const int sensitivity = 10; // Sensitivity for mouse movements |
#include <BleMouse.h> // Include the bleMouse library | |
#include "Adafruit_TinyUSB.h" // Include the Adafruit TinyUSB library | |
BleMouse bleMouse; | |
uint8_t const desc_hid_report[] = {TUD_HID_REPORT_DESC_MOUSE()}; | |
Adafruit_USBD_HID usbMouse(desc_hid_report, sizeof(desc_hid_report), HID_ITF_PROTOCOL_MOUSE, 2, false); | |
const int joystickXPin = 26; // Pin for the X-axis of the joystick | |
const int joystickYPin = 36; // Pin for the Y-axis of the joystick | |
const int joystickButtonPin = 2; // Pin for the joystick button |
#include <TinyUSB_Mouse_and_Keyboard.h> // Include the TinyUSB_Mouse_and_Keyboard library | |
const int joystickXPin = A0; // Pin for the X-axis of the joystick | |
const int joystickYPin = A1; // Pin for the Y-axis of the joystick | |
const int joystickButtonPin = 2; // Pin for the joystick button | |
const int sensitivity = 5; // Sensitivity for mouse movements | |
int xValue = 0; // Value for the X-axis of the joystick | |
int yValue = 0; // Value for the Y-axis of the joystick |
#include <BLEDevice.h> | |
#include <BLEUtils.h> | |
#include <BLEServer.h> | |
#include <BLE2902.h> | |
// Define UUIDs for our service and characteristics | |
#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" | |
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8" | |
// Define the GATT server and client objects |
@echo off | |
echo %1 | ncat -u 192.168.3.240 8888 |
#define SPEED 85 | |
#define TURN_SPEED 90 | |
#define SHIFT_SPEED 130 | |
#define MOVE_DELAY 500 | |
#define TURN_TIME 500 | |
#define MOVE_TIME 500 | |
#define speedPinR 9 // Front Wheel PWM pin connect Model-Y M_B ENA |