Registry / cli / eiannone-keyboard

eiannone-keyboard

JSON →
library0.0.0-20220611211555-0d226195f203gogounverified

A Go library for reading keyboard input in the terminal.

go get github.com/eiannone/keyboard
INSTALL
IMPORT
SIG · EIANNONE-KEYBOARD
E
eiannone-keyboard
cligov0.0.0-20220611211555-0d226195f203
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

keyboard
github.com/eiannone/keyboard

Reads a single key press from the terminal.

package main import ( "fmt" "github.com/eiannone/keyboard" ) func main() { if err := keyboard.Open(); err != nil { panic(err) } defer keyboard.Close() char, key, err := keyboard.GetSingleKey() if err != nil { panic(err) } fmt.Printf("You pressed: %c (key code: %d)\n", char, key) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.0.0-20220611211555-0d226195f203latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
22 hits · last 30 days
node
20
Amazon
1
OpenAI (training)
1
Resources
eiannone-keyboard — go get eiannone-keyboard · libregistry