diff --git a/tty_js.go b/tty_js.go new file mode 100644 index 0000000..ca0fbf3 --- /dev/null +++ b/tty_js.go @@ -0,0 +1,23 @@ +//go:build js + +package keyboard + +import ( + "errors" + "os" +) + +// initInput is a no-op on js/wasm: there is no terminal to configure. +func initInput() error { return nil } + +// restoreInput is a no-op on js/wasm. +func restoreInput() error { return nil } + +// closeInput is a no-op on js/wasm. +func closeInput() {} + +// openInputTTY reports that no controlling terminal exists on js/wasm; +// callers supply input through explicit readers instead. +func openInputTTY() (*os.File, error) { + return nil, errors.New("keyboard: no /dev/tty on js/wasm") +}