beatMouseDown
Description​
This event is fired whenever a the user presses the mouse button on a beat.
beatMouseDownJavaScript |
alphaTab.beatMouseDownjQuery |
alphaTab.beatMouseDownHTML |
BeatMouseDown.net |
Types​
function(beat, originalEvent)JavaScript |
Action<AlphaTab.Model.Beat>.net |
Parameters​
Parameters | Type | Summary |
---|---|---|
beatJavaScript | alphaTab.model.Beat | The new beat that is now being played.. |
originalEventJavaScript & jQuery | MouseEvent | The original mouse event that lead to trigger of the beat event. For the DOM event it is stored in the event.originalEvent. |
beat.net | AlphaTab.Model.Beat | The new beat that is now being played.. |
Examples​
- JavaScript
- HTML
- jQuery
- C#
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.beatMouseDown.on((beat) => {
startSelectionOnBeat(beat);
});
$('#alphaTab').on('alphaTab.beatMouseDown', (e, beat) => {
originalEvent.preventDefault();
startSelectionOnBeat(beat);
});
document.querySelector('#alphaTab').addEventListener('alphaTab.beatMouseDown', (e) => {
const beat = e.detail;
e.originalEvent.preventDefault();
startSelectionOnBeat(beat);
}, false);
var api = new AlphaTabApi<MyControl>(...);
api.BeatMouseDown.On(beat =>
{
StartSelectionOnBeat(args);
});