emekalim5 downloadsAdds Windows Surface Pen controls to Canvas, including mouse emulation and pen-based panning.
Surface Tablet is an Obsidian desktop plugin that makes Canvas usable with a Surface Pen by presenting supported pen interactions to Canvas as mouse interactions.
[!IMPORTANT] Version 1.0 is designed for Obsidian Desktop 1.14 or later on Windows and has been validated with a Microsoft Surface Pen. macOS, Linux, mobile, and non-Surface pens are not supported yet.
In Tablet Mode, Surface Tablet changes the pointerType reported for eligible pen events inside Canvas from pen to mouse. Coordinates, pressure, pointer ID, tilt, and button state are preserved. Mouse and touch input are left unchanged.
The plugin provides two mutually exclusive persistent session modes:
Enabling Pan Mode switches Mouse Emulation off, and enabling Mouse Emulation switches persistent Pan Mode off. In either mode, holding the barrel button before touching Canvas provides temporary panning without changing either highlighted toolbar action.
Specialized embedded targets—active editors, iframes, PDF views, and Excalidraw views—keep native pen input in v1.
When a Canvas is loaded on Windows, its view header contains two actions:
Commands are also available:
Surface Tablet: Toggle mouse emulationSurface Tablet: Enable mouse emulationSurface Tablet: Disable mouse emulationSurface Tablet: Toggle pan modeCanvas pen controls:
The first tap of a contact double-tap is intentionally not delayed, so its context menu may briefly appear click again to toggle Mouse Emulation modes.
Surface Tablet includes settings for:
Runtime toggles last only for the current Obsidian session. Each launch starts from the configured default, and Pan Mode always starts disabled.
main.js, manifest.json, and styles.css from the latest GitHub release.<vault>/.obsidian/plugins/surface-tablet/.The ignored dist/ directory is the complete installable plugin output.
Requirements: Node.js 24 or newer and npm.
npm install
npm run dev # watch and rebuild dist/main.js
npm run verify # lint, format check, tests, metadata check, and production build
Diagnostics are local and disabled by default. To capture a hardware trace:
Surface Tablet: Clear pen diagnostics from the command palette.Surface Tablet: Copy pen diagnostics. This copies the JSON to your clipboard.Capture these gestures separately so their event streams remain easy to compare:
The buffer records changed pointer states inside Canvas, including pen, mouse, and touch classifications plus raw and reported primary-pointer state. It is capped at 500 events and omits note text. Tagged [DEBUG-ST-INPUT-v1] entries are also written to DevTools while logging is enabled.
Designed for Windows Surface devices and validated with a Microsoft Surface Pen on Obsidian Desktop 1.14. Other operating systems and pen hardware have not been validated yet.
See TESTING.md for the validation checklist.