-
Notifications
You must be signed in to change notification settings - Fork 13
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
Clipboard #68
base: master
Are you sure you want to change the base?
Clipboard #68
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.
Hate to be a grammar nazi, but it's a document... Either way, this looks mostly alright, but I'm not entirely sure if this is really necessary. Though, perhaps you should mention what key combinations should be used for pasting/copying before programs decide on their own each.
### Technical Details | ||
Clipboard defines a method to share information like text with other programs. | ||
|
||
It is a Table called "clipboard" in the Shell Environment. |
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.
It is a table called "clipboard" in the shell environment.
Nouns shouldn't be capitalised. There's plenty other instances of this in the document, which I won't comment on to avoid clutter.
|
||
| Header | Description | | ||
| ----------- | -------------------------------------------------------------------------------------- | | ||
| type | A String, that Describes, what is in the Clipboard (see at Point "Types") | |
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.
Describes isn't even a noun... Don't capitalise anything unless it's at the beginning of a sentence or a proper noun (names of people or places, etc.).
| ----------- | -------------------------------------------------------------------------------------- | | ||
| text | Just normal text provided as a String. | | ||
| nfp | A nfp Image provided as String | | ||
| nft | A nft Image provided as String | |
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.
We already have MIME types, just refer to those, it's more flexible.
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.
Definitely
### Usage | ||
Set text of Clipboard: | ||
```lua | ||
clipboard = {type="text",content="Hello World"} |
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.
This being a global makes my soul scream, but there isn't really an alternative I can think of :/.
@@ -11,3 +11,4 @@ This document contains a list of all standards. | |||
| 6 | [Nitrogen Fingers Text](6-nft.md) | File format | Images with text support | | |||
| 7 | [Temporary directory](7-temp-directory.md) | File format | Storing temporary files | | |||
| 10 | [TRoR](10-tror.md) | Protocol | Redirecting terminal state and interactions over Rednet. | | |||
| 11 | [Clipboard](11-clipboard.md) | Protocol | Share Informations with other Programs | |
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.
"Information" should never be plural, it's just "Share information with other programs".
I can see this being useful. I think that maybe an API is the way to go over just a table, but I'm interested to hear what people think. One other thing you might want to add is whether is was cut or copy and if cut then clear it when pasted. I made an API for this for OneOS: https://github.com/oeed/OneOS/blob/master/System/APIs/Clipboard.lua You do also have the issue of the real clipboard interfering. |
I can see the use of a sane clipboard system, but a couple of thoughts:
I'm personally thinking of something like: -- Get an entry of a particular type
function clipboard.get(name:string) end
-- Set the clipboard contents, where entries is a MIME type -> contents lookup
function clipboard.set(entries) end
-- Clear the clipboard
function clipboard.clear() end
Is this a mac-specific thing, as this seems rather weird to me - I'd expect to be able to paste a cut object multiple times.
I guess you could check if the |
I'm not sure if the behaviour @SquidDev seems to have in mind is a thing on certain systems, it does indeed sound more like a bug than a feature. However, what I think @oeed might have meant is the action a program has to perform e.g. when a file has been cut and then pasted. The file isn't moved anywhere from the directory it resides in until the user actually pastes it somewhere else - which might not even happen at all. I'm not sure how the API should handle these cases... |
Thinking about it, you're right, it's not universal. In some programs and situations (i.e. Excel, cutting files) it is the case though. I guess we'd want some way to tell the source that the cut occurred... maybe? Any ideas? It seems a little messy having to do that, but at the very least you'd expect cut files to be moved rather than copied. Perhaps we leave that up to the destination though.
Definitely like that.
Agreed. |
I have seen, that there are now standard for a Clipboard, so I have develop a Standard. It is very easy to use and allow multiple types of informations like text or image.