mirror of https://github.com/gdamore/tcell.git
fixes #76 Set some comments on constant blocks to silence golint
This commit is contained in:
parent
9575857d57
commit
c5d65ed603
8
attr.go
8
attr.go
|
@ -18,17 +18,15 @@ package tcell
|
|||
// Note that support for attributes may vary widely across terminals.
|
||||
type AttrMask int
|
||||
|
||||
// NB: the colors listed here are in the order that ANSI terminals expect.
|
||||
|
||||
// Attributes are not colors, but affect the display of text. They can
|
||||
// be combined.
|
||||
const (
|
||||
AttrBold AttrMask = 1 << (25 + iota)
|
||||
AttrBlink
|
||||
AttrReverse
|
||||
AttrUnderline
|
||||
AttrDim
|
||||
|
||||
// AttrNone is just normal text.
|
||||
AttrNone AttrMask = 0
|
||||
AttrNone AttrMask = 0 // Just normal text.
|
||||
)
|
||||
|
||||
const attrAll = AttrBold | AttrBlink | AttrReverse | AttrUnderline | AttrDim
|
||||
|
|
2
color.go
2
color.go
|
@ -423,6 +423,8 @@ const (
|
|||
ColorYellowGreen
|
||||
)
|
||||
|
||||
// These are aliases for the color gray, because some of us spell
|
||||
// it as grey.
|
||||
const (
|
||||
ColorGrey = ColorGray
|
||||
ColorDimGrey = ColorDimGray
|
||||
|
|
11
key.go
11
key.go
|
@ -261,13 +261,15 @@ func NewEventKey(k Key, ch rune, mod ModMask) *EventKey {
|
|||
// possible to report modifier keys.
|
||||
type ModMask int16
|
||||
|
||||
// These are the modifiers keys that can be sent either with a key press,
|
||||
// or a mouse event.
|
||||
const (
|
||||
ModShift ModMask = 1 << iota
|
||||
ModCtrl
|
||||
ModAlt
|
||||
ModMeta
|
||||
ModNone ModMask = 0
|
||||
)
|
||||
const ModNone ModMask = 0
|
||||
|
||||
// Key is a generic value for representing keys, and especially special
|
||||
// keys (function keys, cursor movement keys, etc.) For normal keys, like
|
||||
|
@ -275,6 +277,10 @@ const ModNone ModMask = 0
|
|||
// inspect the Rune() member of the EventKey.
|
||||
type Key int16
|
||||
|
||||
// This is the list of named keys. KeyRune is special however, in that it is
|
||||
// a place holder key indicating that a printable character was sent. The
|
||||
// actual value of the rune will be transported in the Rune of the associated
|
||||
// EventKey.
|
||||
const (
|
||||
KeyRune Key = iota + 256
|
||||
KeyUp
|
||||
|
@ -365,6 +371,8 @@ const (
|
|||
KeyF64
|
||||
)
|
||||
|
||||
// These are the control keys. Note that they overlap with other keys,
|
||||
// perhaps. For example, KeyCtrlH is the same as KeyBackspace.
|
||||
const (
|
||||
KeyCtrlSpace Key = iota
|
||||
KeyCtrlA
|
||||
|
@ -442,6 +450,7 @@ const (
|
|||
KeyDEL Key = 0x7F
|
||||
)
|
||||
|
||||
// These keys are aliases for other names.
|
||||
const (
|
||||
KeyBackspace = KeyBS
|
||||
KeyTab = KeyTAB
|
||||
|
|
1
mouse.go
1
mouse.go
|
@ -79,6 +79,7 @@ func NewEventMouse(x, y int, btn ButtonMask, mod ModMask) *EventMouse {
|
|||
// emulations (such as vt100) won't support mice at all, of course.
|
||||
type ButtonMask int16
|
||||
|
||||
// These are the actual button values.
|
||||
const (
|
||||
Button1 ButtonMask = 1 << iota // Usually left mouse button.
|
||||
Button2 // Usually the middle mouse button.
|
||||
|
|
1
runes.go
1
runes.go
|
@ -18,7 +18,6 @@ package tcell
|
|||
// modulo case, and changing the prefix from ACS_ to Rune. These are
|
||||
// the runes we provide extra special handling for, with ASCII fallbacks
|
||||
// for terminals that lack them.
|
||||
|
||||
const (
|
||||
RuneSterling = '£'
|
||||
RuneDArrow = '↓'
|
||||
|
|
|
@ -64,8 +64,11 @@ func Size() (int, int) {
|
|||
return screen.Size()
|
||||
}
|
||||
|
||||
// Attribute affects the presentation of characters, such as color, boldness,
|
||||
// and so forth.
|
||||
type Attribute uint16
|
||||
|
||||
// Colors first. The order here is significant.
|
||||
const (
|
||||
ColorDefault Attribute = iota
|
||||
ColorBlack
|
||||
|
@ -77,6 +80,8 @@ const (
|
|||
ColorCyan
|
||||
ColorWhite
|
||||
)
|
||||
|
||||
// Other attributes.
|
||||
const (
|
||||
AttrBold Attribute = 1 << (9 + iota)
|
||||
AttrUnderline
|
||||
|
@ -139,6 +144,7 @@ func Clear(fg, bg Attribute) {
|
|||
// InputMode is not used.
|
||||
type InputMode int
|
||||
|
||||
// Unused input modes; here for compatibility.
|
||||
const (
|
||||
InputCurrent InputMode = iota
|
||||
InputEsc
|
||||
|
@ -156,6 +162,7 @@ func SetInputMode(mode InputMode) InputMode {
|
|||
// are used. See the termbox documentation for an explanation.
|
||||
type OutputMode int
|
||||
|
||||
// OutputMode values.
|
||||
const (
|
||||
OutputCurrent OutputMode = iota
|
||||
OutputNormal
|
||||
|
@ -216,6 +223,7 @@ type Event struct {
|
|||
N int
|
||||
}
|
||||
|
||||
// Event types.
|
||||
const (
|
||||
EventNone EventType = iota
|
||||
EventKey
|
||||
|
@ -226,6 +234,7 @@ const (
|
|||
EventRaw
|
||||
)
|
||||
|
||||
// Keys codes.
|
||||
const (
|
||||
KeyF1 = Key(tcell.KeyF1)
|
||||
KeyF2 = Key(tcell.KeyF2)
|
||||
|
@ -286,6 +295,7 @@ const (
|
|||
MouseMiddle = Key(tcell.KeyF61)
|
||||
)
|
||||
|
||||
// Modifiers.
|
||||
const (
|
||||
ModAlt = Modifier(tcell.ModAlt)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue