all: initial import

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-03-30 13:18:49 +01:00
commit 0f05231c35
102 changed files with 17926 additions and 0 deletions
+74
View File
@@ -0,0 +1,74 @@
// SPDX-License-Identifier: Unlicense OR MIT
package key
type OpHandler struct {
Key Key
Focus bool
}
type OpHideInput struct{}
type Key interface{}
type Events interface {
For(k Key) []Event
}
type Event interface {
isKeyEvent()
}
type Focus struct {
Focus bool
}
type Chord struct {
Name rune
Modifiers Modifiers
}
type Edit struct {
Text string
}
type Modifiers uint32
type TextInputState uint8
const (
ModCommand Modifiers = 1 << iota
)
const (
TextInputKeep TextInputState = iota
TextInputFocus
TextInputClosed
TextInputOpen
)
const (
NameLeftArrow = '←'
NameRightArrow = '→'
NameUpArrow = '↑'
NameDownArrow = '↓'
NameReturn = '⏎'
NameEnter = '⌤'
NameEscape = '⎋'
NameHome = '⇱'
NameEnd = '⇲'
NameDeleteBackward = '⌫'
NameDeleteForward = '⌦'
NamePageUp = '⇞'
NamePageDown = '⇟'
)
func (OpHandler) ImplementsOp() {}
func (OpHideInput) ImplementsOp() {}
func (Edit) ImplementsEvent() {}
func (Chord) ImplementsEvent() {}
func (Focus) ImplementsEvent() {}
func (Edit) isKeyEvent() {}
func (Chord) isKeyEvent() {}
func (Focus) isKeyEvent() {}