-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi clipboard format support for Windows #29
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your PR.
Please fix package path.
We must consider linux and darwin platform..
"flag" | ||
"fmt" | ||
"github.com/kiennq/clipboard" | ||
"io/ioutil" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use github.com/atotto/clipboard
@@ -1,14 +1,12 @@ | |||
package clipboard_test | |||
package clipboard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use clipboard_test
) | ||
|
||
func TestCopyAndPaste(t *testing.T) { | ||
expected := "日本語" | ||
expected := "日本語\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
Add 4 new interface function for clipboard package:
func ReadAllWithFormat(cf uintptr) (string, error)
func WriteAllWithFormat(text string, cf uintptr) error
func ClearClipboard() error
func getClipboardFormat(_ string)
With those, we can set and get multiple data type from clipboard.
One example is in Windows, we can set HTML clipboard and text clipboard simultaneously, application can choose to render which data depends on its needs. The newly add utility goclip is using the new interface to implement copy and paste multiple clipboard data type too.
Please refer to this https://msdn.microsoft.com/en-us/library/windows/desktop/ms649015(v=vs.85).aspx