플러그인로 돌아가기

백스페이스 금지

백스페이스 키를 꺼서 수정 없이 계속 앞으로 써 나가세요.

example.com

No Backspace

Toggle the Backspace key off to stop editing and keep moving forward.

What it does

  • On: pressing Backspace (and, optionally, Ctrl/Cmd+Backspace word-delete and the forward Delete key) does nothing — nothing is deleted.
  • Off: the keyboard works normally.
  • Toggle from four places, all kept in sync via app.storage:
    • the document/sheet toolbar lock button — lives right in the working window, next to the other toolbar buttons (registerHeaderAction, fileTypes: ['document', 'sheet'])
    • the app-header lock button (Timer-button area, project-level)
    • the command palette ("No Backspace: Toggle", bindable to a shortcut)
    • the plugin's settings tab
  • Settings → Compatibility → "Play nicely with other plugins" controls whether this plugin coexists with other plugins that also touch Backspace (default: on — other plugins get first chance at the key) or takes exclusive priority so it always wins (off). This uses TipTap's per-extension priority, so it's read once at load; flip it and re-enable the plugin for it to take effect.

How it works

  • manifest.json declares the editor.intercept permission — the gate for any plugin that wants to swallow keystrokes.
  • src/extension.ts is a small TipTap Extension registered via this.registerEditorExtension(...). Its addKeyboardShortcuts() handlers read app.storage live on every keypress and return true (swallow the key) when blocking is on, or false (let it through) otherwise — so the header button / palette command / settings toggle all take effect instantly, no reload needed.
  • src/main.ts wires the command, the document/sheet toolbar button (registerHeaderAction), the app-header button (registerAppHeaderAction; both use the built-in isActive pressed-state — no custom render needed), the settings tab, and the extension itself.
  • src/settings.ts / src/i18n.ts follow the SDK's declarative-schema and L/tr/STR localization conventions (English, Korean, Japanese).

Build

npm install
npm run build

Produces dist/main.js, which the pensiv app packages into a .pnsv-plugin and installs alongside manifest.json.

Note: @pensiv/plugin-sdk / @pensiv/build-config are provided by the pensiv monorepo/host at build & runtime and aren't on the public npm registry, so npm install only resolves here once this folder is dropped into (or referenced from) the pensiv-plugins monorepo workspace — same as any other plugin cloned from plugins/sample-plugin.

비슷한 리소스