Clipboard.GetText() always returns empty string in Mono on Mac

前端 未结 2 1407
一生所求
一生所求 2020-12-22 07:25

Is there a way to get the clipboard on a Mac in Mono that doesn\'t return an empty string? This is using the latest NON-beta version of mono.

Clipboard.SetText(Strin

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-22 07:36

    The solution ended up being to use NSPasteboard on mac. https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSPasteboard_Class/Reference/Reference.html

    I could not ever get Clipboard to return anything. Mono has wrappers around NSPasteboard so it ended up being pretty easy this way.

提交回复
热议问题