Bluetooth端末で動作する。(CC0 License)
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>A10 Cyclone SA easy controller</title> </head> <body> <span id="status">initializing...</span> <script> let status = document.querySelector('span#status'); let device, characteristic; const connect = async _ => { try { device = await navigator.bluetooth.requestDevice({ filters: [{ services: ['40ee1111-63ec-4b7f-8ce7-712efd55b90e'] }], }); status.textContent = 'connecting...'; let server = await device.gatt.connect(); let service = await server.getPrimaryService('40ee1111-63ec-4b7f-8ce7-712efd55b90e'); characteristic = await service.getCharacteristic('40ee2222-63ec-4b7f-8ce7-712efd55b90e'); } catch (e) { status.textContent = `failed to connect: ${e.message}`; return; } document.addEventListener('pointermove', evt => { evt.preventDefault(); let y = evt.y / innerHeight * 2 - 1; let data = Math.abs(y) * 0x7f | (y < 0 ? 0x80 : 0x00); characteristic.writeValue(new Int8Array([0x01, 0x01, data])); }); status.textContent = 'swipe up and down to move'; document.removeEventListener('click', connect); } document.addEventListener('click', connect); status.textContent = 'tap screen to connect'; </script> </body> </html>
オナホをとびっ子みたいに使うってこと? わからん。
そうとも限らん。Bluetooth機能はコンテンツとオナホの動作を連動させるために付いてたはず。Pornhub VRみたいにWebで見られるVRコンテンツからチンポコを直で叩くのが真っ当な使い道かな
APIを叩く、みたいな感じで言われてもw