Piano element handles motion events
This commit is contained in:
parent
5ca9206f65
commit
bffdb000ed
@ -88,13 +88,11 @@ func (element *Piano) HandleMouseUp (x, y int, button input.Button) {
|
|||||||
element.redo()
|
element.redo()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (element *Piano) HandleMouseMove (x, y int) {
|
func (element *Piano) HandleMotion (x, y int) {
|
||||||
if element.pressed == nil { return }
|
if element.pressed == nil { return }
|
||||||
element.pressUnderMouseCursor(image.Pt(x, y))
|
element.pressUnderMouseCursor(image.Pt(x, y))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (element *Piano) HandleMouseScroll (x, y int, deltaX, deltaY float64) { }
|
|
||||||
|
|
||||||
func (element *Piano) pressUnderMouseCursor (point image.Point) {
|
func (element *Piano) pressUnderMouseCursor (point image.Point) {
|
||||||
// find out which note is being pressed
|
// find out which note is being pressed
|
||||||
newKey := (*pianoKey)(nil)
|
newKey := (*pianoKey)(nil)
|
||||||
|
Reference in New Issue
Block a user