Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions tty_js.go
Original file line number Diff line number Diff line change
@@ -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")
}