Documentation ¶
Index ¶
- Constants
- func Bento() palette
- func Dark() palette
- func Dots() palette
- func Dracula() palette
- func Dualshot() palette
- func Hammerhead() palette
- func Laser() palette
- func Nautilus() palette
- func NewThemes() themes
- func Oblivion() palette
- func Olive() palette
- type ConfigWidget
- type MenuAction
- type Status
- type StatusWidget
- func (t *StatusWidget) ApplyColor(p palette)
- func (t *StatusWidget) GetAccuracy() float64
- func (t *StatusWidget) GetCount() int
- func (t *StatusWidget) GetElapsed() float64
- func (t *StatusWidget) GetGrossWpm() float64
- func (t *StatusWidget) GetNetWpm() float64
- func (w *StatusWidget) Init(words []string)
- func (t *StatusWidget) IsStarted() bool
- func (t *StatusWidget) Reset()
- type ThemeList
- func (t *ThemeList) ApplyColor(p palette)
- func (t *ThemeList) GetCurrentTheme() string
- func (t *ThemeList) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (t *ThemeList) SetActionFunc(doneFunc func(action MenuAction))
- func (t *ThemeList) SetDoneFunc(doneFunc func())
- func (t *ThemeList) SetVisible(visible bool)
- type TypingWidget
- type Word
Constants ¶
const ( English = 0 Korean )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigWidget ¶
type ConfigWidget struct { *tview.Flex LanguageList *tview.DropDown SoundList *tview.DropDown WordCountList *tview.DropDown // contains filtered or unexported fields }
func NewConfigWidget ¶
func NewConfigWidget() *ConfigWidget
func (*ConfigWidget) ApplyColor ¶
func (w *ConfigWidget) ApplyColor(p palette)
func (*ConfigWidget) GetNextOption ¶
func (w *ConfigWidget) GetNextOption() (opt *tview.DropDown)
func (*ConfigWidget) SetLanguage ¶
func (w *ConfigWidget) SetLanguage(lang int)
type MenuAction ¶
type MenuAction int
const ( MenuActionNone MenuAction = iota MenuActionImportTheme )
type Status ¶
type Status struct { Entries int // total character count WrongEntries int // wrong character count Words []Word // word list StartTime time.Time // start time // contains filtered or unexported fields }
Status describe general typing status (wpm, time, accuracy ..)
func (*Status) GetCurrentWord ¶
type StatusWidget ¶
type StatusWidget struct { *tview.Flex Wpm *tview.TextView Accuracy *tview.TextView Timer *tview.TextView Count *tview.TextView Status *Status // contains filtered or unexported fields }
StatusWidget is frame which display general typing information ( wpm, time ,,) it include tview.TextView struct
func NewStatusWidget ¶
func NewStatusWidget() *StatusWidget
NewStatusWidget returns initialized StatusWidget
func (*StatusWidget) GetAccuracy ¶
func (t *StatusWidget) GetAccuracy() float64
GetAccuracy returns current word accuracy
func (*StatusWidget) GetCount ¶
func (t *StatusWidget) GetCount() int
GetCount returns typed sentence count
func (*StatusWidget) GetElapsed ¶
func (t *StatusWidget) GetElapsed() float64
GetElapsed returns current time elapsed
func (*StatusWidget) GetGrossWpm ¶
func (t *StatusWidget) GetGrossWpm() float64
GetGrossWpm returns current wpm (word per minutes) * Gross WPM = (All typed entries) / Time (min)
func (*StatusWidget) GetNetWpm ¶
func (t *StatusWidget) GetNetWpm() float64
GetNetWpm returns current wpm include errors * Net WPM = (All typed entries / 5) - ( Uncorrected Errors / Time (min) )
func (*StatusWidget) Init ¶
func (w *StatusWidget) Init(words []string)
Init initialize string slice of status widget
func (*StatusWidget) IsStarted ¶
func (t *StatusWidget) IsStarted() bool
IsStarted returns typing is started
func (*StatusWidget) Reset ¶
func (t *StatusWidget) Reset()
type ThemeList ¶
ThemeList is a box which display text theme list
func NewThemeList ¶
func NewThemeList() *ThemeList
func (*ThemeList) ApplyColor ¶
func (t *ThemeList) ApplyColor(p palette)
func (*ThemeList) GetCurrentTheme ¶
func (*ThemeList) InputHandler ¶
func (*ThemeList) SetActionFunc ¶
func (t *ThemeList) SetActionFunc(doneFunc func(action MenuAction))
func (*ThemeList) SetDoneFunc ¶
func (t *ThemeList) SetDoneFunc(doneFunc func())
func (*ThemeList) SetVisible ¶
type TypingWidget ¶
type TypingWidget struct { *tview.Flex Text *tview.TextView Input *tview.InputField Words languages DisplayWords languages CurrentIndex int // contains filtered or unexported fields }
TypingBox is a box which display words be typed It include struct of tview.TextView , tview.InputField
func NewTypingWidget ¶
func NewTypingWidget() *TypingWidget
func (*TypingWidget) ApplyColor ¶
func (w *TypingWidget) ApplyColor(p palette)
ApplyColor apply current theme color on widget
func (*TypingWidget) ClearInputBox ¶
func (w *TypingWidget) ClearInputBox()
func (*TypingWidget) ProcessNextWord ¶
func (w *TypingWidget) ProcessNextWord()
func (*TypingWidget) Reset ¶
func (w *TypingWidget) Reset()
func (*TypingWidget) Update ¶
func (w *TypingWidget) Update(colored string, index int)
Update updates word list whether it is correct or not
func (*TypingWidget) UpdateWords ¶
func (w *TypingWidget) UpdateWords(number int)