-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
Description
For ASCII alpha-numeric characters and very common keys such as Enter, shift, ctrl, arrows... create an abstraction on the keyboard the exposes those with utmost simplicity, i.e.
type LazyKey interface {
Press() error
Release() error
Punch() error
}
type LazyKeyboard interface {
A() LazyKey
B() LazyKey
// ... etc
Enter() LazyKey
}
// usage
func main() {
// wrap keyboard in lazy wrapper
kb := gostwriter.LazyKeyboard(gostwriter.New("foo"))
// be a good girl and handle errors
err := kb.A().Press()
// handle the error somehow
// or ignore errors, whatever
kb.A().Punch()
}
Reactions are currently unavailable