mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 03:58:55 +01:00
uidriver: Copy the runes on the callee sides
This commit is contained in:
parent
82dc7a6591
commit
14070ee153
3
input.go
3
input.go
@ -32,8 +32,7 @@ import (
|
|||||||
//
|
//
|
||||||
// Keyboards don't work on iOS yet (#1090).
|
// Keyboards don't work on iOS yet (#1090).
|
||||||
func InputChars() []rune {
|
func InputChars() []rune {
|
||||||
rb := uiDriver().Input().RuneBuffer()
|
return uiDriver().Input().RuneBuffer()
|
||||||
return append(make([]rune, 0, len(rb)), rb...)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsKeyPressed returns a boolean indicating whether key is pressed.
|
// IsKeyPressed returns a boolean indicating whether key is pressed.
|
||||||
|
@ -218,7 +218,8 @@ func (i *Input) RuneBuffer() []rune {
|
|||||||
}
|
}
|
||||||
var r []rune
|
var r []rune
|
||||||
_ = i.ui.t.Call(func() error {
|
_ = i.ui.t.Call(func() error {
|
||||||
r = i.runeBuffer
|
r = make([]rune, len(i.runeBuffer))
|
||||||
|
copy(r, i.runeBuffer)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
return r
|
return r
|
||||||
|
@ -142,7 +142,9 @@ func (i *Input) TouchPosition(id driver.TouchID) (x, y int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *Input) RuneBuffer() []rune {
|
func (i *Input) RuneBuffer() []rune {
|
||||||
return i.runeBuffer
|
rs := make([]rune, len(i.runeBuffer))
|
||||||
|
copy(rs, i.runeBuffer)
|
||||||
|
return rs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Input) resetForFrame() {
|
func (i *Input) resetForFrame() {
|
||||||
|
@ -164,7 +164,9 @@ func (i *Input) TouchPosition(id driver.TouchID) (x, y int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *Input) RuneBuffer() []rune {
|
func (i *Input) RuneBuffer() []rune {
|
||||||
return i.runes
|
rs := make([]rune, len(i.runes))
|
||||||
|
copy(rs, i.runes)
|
||||||
|
return rs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Input) IsKeyPressed(key driver.Key) bool {
|
func (i *Input) IsKeyPressed(key driver.Key) bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user