Skip to content

Commit e5c4bc7

Browse files
committed
Add Ctrl/Shift/Alt/Meta key modifiers to the "doubleclicked" signal.
This will be for allowing to double-click to fit peaks in background/secondary spectrum.
1 parent 2b0e250 commit e5c4bc7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

d3_resources/SpectrumChartD3.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,9 +2517,9 @@ SpectrumChartD3.prototype.handleVisMouseUp = function () {
25172517
return;
25182518
}
25192519

2520-
const modKeyPressed = (d3.event.altKey || d3.event.ctrlKey || d3.event.metaKey
2521-
|| d3.event.shiftKey || self.escapeKeyPressed);
2522-
2520+
const modifiers = (d3.event.shiftKey ? 0x01 : 0) | (d3.event.ctrlKey ? 0x02 : 0) | (d3.event.altKey ? 0x04 : 0) | (d3.event.metaKey ? 0x08 : 0);
2521+
const modKeyPressed = ((modifiers != 0) || self.escapeKeyPressed);
2522+
25232523
/* Figure out clicks and double clicks */
25242524
const nowtime = new Date();
25252525

@@ -2537,7 +2537,7 @@ SpectrumChartD3.prototype.handleVisMouseUp = function () {
25372537
self.mouseDownRoi = null;
25382538
}
25392539

2540-
self.WtEmit(self.chart.id, {name: 'doubleclicked'}, energy, count, self.currentRefLineInfoStr() );
2540+
self.WtEmit(self.chart.id, {name: 'doubleclicked'}, energy, count, self.currentRefLineInfoStr(), modifiers );
25412541
} else {
25422542
// This is the first click - maybe there will be another click, maybe not
25432543
if( !modKeyPressed )

0 commit comments

Comments
 (0)