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

Input events? #262

Open
skaematik opened this issue May 25, 2018 · 8 comments
Labels

Comments

@skaematik
Copy link

@skaematik skaematik commented May 25, 2018

Is there any plan to support events within opensheetmusicdisplay?

The most basic event that I'm looking for is onhover or onclick of a note (rendered with SVG).

Thank you!

@bneumann

This comment has been minimized.

Copy link
Collaborator

@bneumann bneumann commented May 25, 2018

Hi Annie,

That's actually a really nice idea. But also not that easy to implement. I will investigate the effort and feasibility

@skaematik

This comment has been minimized.

Copy link
Author

@skaematik skaematik commented May 25, 2018

There is some discussion on this topic on the VexFlow side. This may be of use:
0xfe/vexflow#371
https://jsfiddle.net/gristow/j0j14sos/

@matt-uib

This comment has been minimized.

Copy link
Collaborator

@matt-uib matt-uib commented May 25, 2018

@skaematik click events (e.g. adding a listener for click on Note, or another object like a measure) are planned. This will be a necessary part when we start implementing our planned playback engine, which needs setting the start position.

@bneumann

This comment has been minimized.

Copy link
Collaborator

@bneumann bneumann commented May 25, 2018

The code from gristow is pretty good. With the new voice entry class it should be pretty simple to adapt this and is actually a good thing to contribute. @skaematik do you want to do it?

@skaematik

This comment has been minimized.

Copy link
Author

@skaematik skaematik commented May 28, 2018

@bneumann Ben, I'm not familiar with TypeScript unfortunately. If you hop on Gitter, we can have a chat there.

@philipp-siegmantel

This comment has been minimized.

Copy link

@philipp-siegmantel philipp-siegmantel commented Oct 5, 2019

Are there any updates for this issue? VexFlow started implementing mouse event support, see this test.

If not, can anyone tell me whether overlaying an element with a div still the preferred approach? Or should I convert the elements I want to be clickable to VexFlow objects and use their event management?

What I'm trying to do, is playing a note the user has clicked on. Any hints are welcomed.

@sschmidTU

This comment has been minimized.

Copy link
Contributor

@sschmidTU sschmidTU commented Oct 5, 2019

There are some code snippets on how to possibly implement this in #504.

Supporting click events seems like a popular feature request, and is a good candidate to be implemented soon, but it'll need some work, and the team members are currently a bit preoccupied elsewhere. But we're probably implementing other features for OSMD soon (e.g. multi measure rests), so this would be a nice addition.

@sschmidTU

This comment has been minimized.

Copy link
Contributor

@sschmidTU sschmidTU commented Oct 5, 2019

By the way, that VexFlow test is very interesting, might be an easier method of supporting events for notes by getting their element.
On the other hand, that might not work for all graphical elements, like text and some slurs, which we draw ourselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.