//============================================================================== void PianoGridKeyboard::mouseWheelMove (const MouseEvent&, const MouseWheelDetails& wheel) { int newNote = getLowestVisibleKey(); if ((wheel.deltaX != 0 ? wheel.deltaX : wheel.deltaY) < 0) newNote = (newNote - 1) / 12; else newNote = newNote / 12 + 1; setLowestVisibleKey (newNote * 12); }
void MidiKeyboardComponent::mouseWheelMove (const MouseEvent&, float ix, float iy) { setLowestVisibleKey (getLowestVisibleKey() + roundToInt ((ix != 0 ? ix : iy) * 5.0f)); }