useImeInput
Receives IME-composed text (Japanese, Chinese, Korean, etc.) for wallpapers that want to accept text input — for example a wallpaper-resident notepad, search box, or chat input.
Unlike useKeyboard, which streams raw pre-IME keystrokes from every window on the desktop, useImeInput only delivers text that the user explicitly directs at the wallpaper. Internally Fluxlay creates a tiny invisible proxy window per wallpaper (1×1 px, fully transparent, non-activating). Calling activate() gives that proxy keyboard focus so IME composition is routed through it. The wallpaper window itself never becomes a key window, so the "always-in-background" property of wallpapers is preserved.
Requires the ime-input permission
You must declare ime-input in fluxlay.yaml:
If the permission is missing the backend rejects every IME request with HTTP 403. The hook still mounts and exposes the same API, but no streams flow and activate() / deactivate() are accepted by the SDK without effect. See manifest for the full permission list. Note that ime-input and keyboard are intentionally separate: keyboard exposes global keystrokes, while ime-input only sees text directed at the wallpaper itself.
Import
Signature
Usage
API
Do not pass a React MouseEvent or other arbitrary object directly to activate — only an HTMLElement or a { x, y, height } rect is interpreted correctly. If you wire up onClick, wrap it (onClick={() => ime.activate(ref.current ?? undefined)}) instead of onClick={ime.activate}.
Interaction with useKeyboard
While activate() is in effect, useKeyboard events are paused on the same wallpaper to prevent IME candidate-window keys (arrows, Enter, Esc) from double-firing as raw key events. They resume normally after deactivate().
Platform notes
- macOS: The proxy is an
NSPanelwith.nonactivatingPanelstyle, so the Dock highlight and menu bar do not switch when activated. - Windows: The proxy is a
WS_EX_NOACTIVATEinvisible HWND, so the taskbar does not flash when focus moves.
Limitations
- Only the committed string ends up in the wallpaper. To style the in-progress text, render
compositionyourself. - Coordinates passed to
activateare viewport-relative CSS pixels. The backend resolves the wallpaper window's screen position itself, so do not addwindow.screenX/window.screenYmanually — WebKit's values for those properties are unreliable in custom-scheme wallpaper contexts.