|
| 1 | +# HapticWeb |
| 2 | + |
| 3 | +> A Logi Actions SDK plugin that exposes MX Master 4 haptic feedback via a local HTTPS server and WebSocket API. |
| 4 | + |
| 5 | +HapticWeb enables web applications to trigger haptic feedback on Logitech MX Master 4 mice through a simple REST and WebSocket API running locally. |
| 6 | + |
| 7 | +## Website |
| 8 | + |
| 9 | +- Homepage: https://haptics.jmw.nz |
| 10 | +- Source Code: https://github.com/fallstop/HapticWebPlugin |
| 11 | + |
| 12 | +## Pages |
| 13 | + |
| 14 | +- [Home](https://haptics.jmw.nz/): Overview of the HapticWeb plugin and its capabilities |
| 15 | +- [Install](https://haptics.jmw.nz/install): Installation guide for the plugin |
| 16 | +- [Integrate](https://haptics.jmw.nz/integrate): Developer guide for adding haptics to web apps |
| 17 | +- [API Reference](https://haptics.jmw.nz/api): Complete REST and WebSocket API documentation |
| 18 | +- [Playground](https://haptics.jmw.nz/playground): Interactive demo to try all 16 haptic waveforms |
| 19 | + |
| 20 | +## Requirements |
| 21 | + |
| 22 | +- Logitech MX Master 4 mouse |
| 23 | +- Logi Options+ installed |
| 24 | +- Logi Plugin Service running |
| 25 | + |
| 26 | +## API Overview |
| 27 | + |
| 28 | +The plugin runs an HTTPS server on `https://local.jmw.nz:41443/` when loaded. |
| 29 | + |
| 30 | +### REST Endpoints |
| 31 | + |
| 32 | +| Endpoint | Method | Description | |
| 33 | +|----------|--------|-------------| |
| 34 | +| `/` | GET | Health check with service info and available endpoints | |
| 35 | +| `/waveforms` | GET | List all 15 available haptic waveforms | |
| 36 | +| `/haptic/{waveform}` | POST | Trigger a specific haptic waveform | |
| 37 | + |
| 38 | +### WebSocket Endpoint |
| 39 | + |
| 40 | +`wss://local.jmw.nz:41443/ws` |
| 41 | + |
| 42 | +Send a single byte containing the waveform index (0-14) to trigger haptic feedback. |
| 43 | + |
| 44 | +## Available Waveforms |
| 45 | + |
| 46 | +| Waveform | Index | Category | |
| 47 | +|----------|-------|----------| |
| 48 | +| `sharp_collision` | 0 | Precision enhancers | |
| 49 | +| `sharp_state_change` | 1 | Progress indicators | |
| 50 | +| `knock` | 2 | Incoming events | |
| 51 | +| `damp_collision` | 3 | Precision enhancers | |
| 52 | +| `mad` | 4 | Progress indicators | |
| 53 | +| `ringing` | 5 | Incoming events | |
| 54 | +| `subtle_collision` | 6 | Precision enhancers | |
| 55 | +| `completed` | 7 | Progress indicators | |
| 56 | +| `jingle` | 8 | Incoming events | |
| 57 | +| `damp_state_change` | 9 | Precision enhancers | |
| 58 | +| `firework` | 10 | Progress indicators | |
| 59 | +| `happy_alert` | 11 | Progress indicators | |
| 60 | +| `wave` | 12 | Progress indicators | |
| 61 | +| `angry_alert` | 13 | Progress indicators | |
| 62 | +| `square` | 14 | Progress indicators | |
| 63 | + |
| 64 | +## Quick Start |
| 65 | + |
| 66 | +### REST API Example |
| 67 | + |
| 68 | +```bash |
| 69 | +# Trigger haptic feedback |
| 70 | +curl -X POST -d '' https://local.jmw.nz:41443/haptic/sharp_collision |
| 71 | +``` |
| 72 | + |
| 73 | +### WebSocket Example (JavaScript) |
| 74 | + |
| 75 | +```javascript |
| 76 | +const ws = new WebSocket('wss://local.jmw.nz:41443/ws'); |
| 77 | + |
| 78 | +ws.onopen = () => { |
| 79 | + // Trigger "completed" waveform (index 7) |
| 80 | + ws.send(new Uint8Array([7])); |
| 81 | +}; |
| 82 | +``` |
| 83 | + |
| 84 | +## Technical Details |
| 85 | + |
| 86 | +- **Server:** NetCoreServer-based HTTPS/WSS |
| 87 | +- **Port:** 41443 (HTTPS only) |
| 88 | +- **Certificate:** Auto-managed, uses local.jmw.nz domain |
| 89 | +- **CORS:** Enabled for any origin |
| 90 | +- **Binding:** 127.0.0.1 only |
| 91 | + |
| 92 | +## License |
| 93 | + |
| 94 | +MIT License - See https://github.com/fallstop/HapticWebPlugin/blob/main/LICENSE.md |
0 commit comments