Compare commits
3 Commits
8b1b2e4199
...
177167510b
Author | SHA1 | Date | |
---|---|---|---|
177167510b | |||
3077249a13 | |||
38d950f44a |
@ -159,6 +159,7 @@ func (this *TextInput) Redo () {
|
|||||||
// Type types a character at the current dot position.
|
// Type types a character at the current dot position.
|
||||||
func (this *TextInput) Type (char rune) {
|
func (this *TextInput) Type (char rune) {
|
||||||
dot := this.Dot()
|
dot := this.Dot()
|
||||||
|
this.historySwapDot()
|
||||||
this.text, dot = text.Type(this.text, dot, rune(char))
|
this.text, dot = text.Type(this.text, dot, rune(char))
|
||||||
this.Select(dot)
|
this.Select(dot)
|
||||||
this.box.SetText(string(this.text))
|
this.box.SetText(string(this.text))
|
||||||
@ -214,6 +215,7 @@ func (this *TextInput) handleKeyDown (key input.Key, numpad bool) bool {
|
|||||||
this.box.SetText(string(txt))
|
this.box.SetText(string(txt))
|
||||||
this.box.Select(dot)
|
this.box.Select(dot)
|
||||||
this.on.valueChange.Broadcast()
|
this.on.valueChange.Broadcast()
|
||||||
|
this.on.dotChange.Broadcast()
|
||||||
this.logKeystroke()
|
this.logKeystroke()
|
||||||
}
|
}
|
||||||
} ()
|
} ()
|
||||||
@ -246,7 +248,7 @@ func (this *TextInput) handleKeyDown (key input.Key, numpad bool) bool {
|
|||||||
case key.Printable() && !modifiers.Control:
|
case key.Printable() && !modifiers.Control:
|
||||||
typeRune()
|
typeRune()
|
||||||
return true
|
return true
|
||||||
case key == 'z' && modifiers.Control:
|
case key == 'z' || key == 'Z' && modifiers.Control:
|
||||||
if modifiers.Shift {
|
if modifiers.Shift {
|
||||||
this.Redo()
|
this.Redo()
|
||||||
} else {
|
} else {
|
||||||
@ -296,7 +298,6 @@ func (this *TextInput) handleScroll (x, y float64) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *TextInput) handleDotChange () {
|
func (this *TextInput) handleDotChange () {
|
||||||
println("asdjhk")
|
|
||||||
this.historySwapDot()
|
this.historySwapDot()
|
||||||
this.on.dotChange.Broadcast()
|
this.on.dotChange.Broadcast()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user