Use case
On iPad, native drawing apps such as GoodNotes can respond to the Apple Pencil barrel double-tap and use it to switch between tools such as pen and eraser.
Obsidian Community Plugins currently run inside the mobile WebView, so plugin developers can receive normal PointerEvent/TouchEvent input from the Pencil tip, but cannot directly access native iOS Pencil interactions such as UIPencilInteraction.
This prevents handwriting and drawing plugins from supporting the same Apple Pencil tool-switching behavior available in native iPad apps.
Proposed solution
Expose Apple Pencil interaction events through Obsidian’s mobile plugin API.
For example, an API could provide an event such as:
this.registerEvent(
this.app.workspace.on("apple-pencil-double-tap", (event) => {
// Switch pen/eraser, previous tool, etc.
})
);
The exact API design does not matter. The important part is exposing the native Pencil interaction to Community Plugin developers.
Ideally, the event would also expose or respect the user’s configured Apple Pencil action in iPadOS, such as:
-
switch between current tool and eraser
-
switch to previous tool
-
show a tool palette
-
other Pencil actions supported by iPadOS
Why this should be exposed through the plugin API
This does not require Obsidian itself to implement handwriting or drawing tools. It would simply provide the native event bridge so plugins can decide how to use it.
Possible plugin use cases include:
-
handwriting plugins switching pen ↔ eraser
-
drawing plugins switching between current/previous tools
-
annotation plugins opening tool controls
-
plugins supporting future Apple Pencil interaction capabilities
My immediate use case is the Handwriting Natively plugin, where Apple Pencil double-tap could switch directly between the active drawing tool and the eraser.
Related
This is related to the broader requests for Apple Pencil/drawing support in Obsidian, but is specifically a request for a mobile plugin API/native bridge, rather than built-in handwriting functionality.