Skip to content
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

Use system clipboard for hitobjects in the editor #27707

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

minetoblend
Copy link
Contributor

@minetoblend minetoblend commented Mar 24, 2024

Uses the system clipboard when copy-pasting hitobjects in the editor. When copying hitobjects, 2 clipboard entries will be created:

  • text/plain: contains the timestamp
  • osu/hitobjects: contains the json-serialized version of the copied hitobjects

This allows copy-pasting objects between osu and external tools.

2024-03-24.02-04-50.mp4

Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aside from the framework prereq

@@ -16,6 +16,8 @@ public class ClipboardContent
[JsonConverter(typeof(TypedListConverter<HitObject>))]
public IList<HitObject> HitObjects;

public const string CLIPBOARD_FORMAT = "osu/hitobjects";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a valid mime format, should probably be something like application/x-osu-hitobjects

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.rfc-editor.org/rfc/rfc6838.html#section-3.4

Subtype names with "x." as the first facet may be used for types
intended exclusively for use in private, local environments.

https://www.rfc-editor.org/rfc/rfc6838.html#section-4.2.8

Since this was published, the de facto practice has arisen for using
this suffix convention for other well-known structuring syntaxes. In
particular, media types have been registered with suffixes such as
"+der", "+fastinfoset", and "+json". This specification formalizes
this practice and sets up a registry for structured type name
suffixes.

So it should be application/x.osu.hitobjects+json.

Please note that web custom formats are prefixed with web in the javascript API (an image/png and web image/png can be different things). I'm still thinking about how this should be handled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants