fix: fixed wrong work with the inpututil.AppendPressedKey(...).
This commit is contained in:
parent
7c6f8f8f45
commit
eda12973e9
1 changed files with 6 additions and 3 deletions
|
@ -233,9 +233,6 @@ func (e *Engine) Runes() []rune {
|
|||
func (e *engine) updateEvents() Events {
|
||||
|
||||
eng := (*Engine)(e)
|
||||
e.prevKeys = e.keys
|
||||
e.keys = inpututil.
|
||||
AppendPressedKeys(e.keys[:0])
|
||||
|
||||
events := Events{}
|
||||
|
||||
|
@ -287,6 +284,12 @@ func (e *engine) updateEvents() Events {
|
|||
e.cursorPos = realPos
|
||||
}
|
||||
|
||||
e.prevKeys = e.keys
|
||||
//newKeys := []Key{e.keys[0]}
|
||||
e.keys = nil
|
||||
e.keys = inpututil.
|
||||
AppendPressedKeys(e.keys[:0])
|
||||
|
||||
// Keyboard.
|
||||
keyDiff := diffEm(e.prevKeys, e.keys)
|
||||
for _, key := range keyDiff {
|
||||
|
|
Loading…
Reference in a new issue