Closed sshadmand closed 2 years ago
This would require changes to Peaks.js to expose the underlying DOM or Konva event, e.g., in click
and dblclick
events, etc. It sounds like a reasonable thing to add though.
I have just created a branch that exposes the MouseEvent
so that you can check the key states, for example:
// Before
peaks.on('zoomview.click', function(time) {
console.log(time);
});
// After
peaks.on('zoomview.click', function(event) {
console.log(event.time);
console.log(event.evt.ctrlKey);
console.log(event.evt.shiftKey);
});
Feedback welcome (see #427 for more details)
This is now implemented (as described above) in Peaks.js v1.0.0. I'll close this, but please re-open if you need any further help.
First, thanks for you work on Peaks.js!
I'd like to know if a key (namely ctrlKey or shiftKey) is being pressed when a user interacts with the rendered waveform. I can see information about the timecode is passed (https://github.com/bbc/peaks.js#events) in an event, but can't figure out how to know the event.keyCode. Thank you in advance for any direction you may provide.