Skip to content

Commit dc5c5d5

Browse files
authored
fix: paste not working in macOS (#376)
1 parent f67b5ec commit dc5c5d5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

textinput.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package flutter
33
import (
44
"encoding/json"
55
"fmt"
6+
"runtime"
67
"unicode"
78

89
"github.com/go-flutter-desktop/go-flutter/plugin"
@@ -199,6 +200,15 @@ func (p *textinputPlugin) glfwKeyCallback(window *glfw.Window, key glfw.Key, sca
199200
window.SetClipboardString(selectedContent)
200201
p.removeSelectedText()
201202
}
203+
204+
case p.keyboardLayout.Paste:
205+
if runtime.GOOS != "darwin" {
206+
break
207+
}
208+
if keyboardShortcutBind.isModifier() {
209+
clpString := window.GetClipboardString()
210+
p.addChar([]rune(clpString))
211+
}
202212
}
203213
p.updateEditingState()
204214
}

0 commit comments

Comments
 (0)