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

How to sustain Active Notes on Mouse Over? #59

Open
kyasuzuki opened this issue Mar 12, 2020 · 3 comments
Open

How to sustain Active Notes on Mouse Over? #59

kyasuzuki opened this issue Mar 12, 2020 · 3 comments

Comments

@kyasuzuki
Copy link

Hi Kevin,
Thank you so much for your contribution of react-piano. I am utilizing your package to display different piano chord shapes - when a user selects a chord shape (e.g. Major), I have set those notes in Active Notes (& in turn, Active Notes highlights the 3 keys on the piano that make C Major). This all functions correctly. However, if I move my mouse over any of the highlighted keys (active), they become unhighlighted (inactive). How can I change this property such that unless a new array of Active notes is provided, the keys remain highlighted & are unaffected by mouseover? Thank you!

@kevinsqi
Copy link
Owner

That's a cool idea and a feature I'd been thinking about - being able to render static non-interactive pianos. I think it would take a few changes to make that happen though.

(related to: #27)

@ilionic
Copy link

ilionic commented Jun 1, 2020

Also interested. Do I understand correctly code responsible for it is here?

react-piano/src/Piano.js

Lines 49 to 52 in 5d6c62a

onMouseDown={props.onNoteDown}
onMouseUp={props.onNoteUp}
onMouseEnter={props.isMouseDown ? props.onNoteDown : null}
onMouseLeave={props.isMouseDown ? props.onNoteUp : null}

@agualdron
Copy link

I posted a possible solution on: #27
#27 (comment)

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

No branches or pull requests

4 participants