We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 31ae91d commit 0d12cadCopy full SHA for 0d12cad
src/mpl_widget.ts
@@ -757,6 +757,7 @@ export class MPLCanvasView extends DOMWidgetView {
757
y: y,
758
button: event.button,
759
step: event.step,
760
+ modifiers: utils.getModifiers(event),
761
guiEvent: utils.get_simple_keys(event),
762
});
763
};
src/utils.ts
@@ -33,3 +33,20 @@ export function getContext(canvas: HTMLCanvasElement) {
33
}
34
return context;
35
36
+
37
+export function getModifiers(event: MouseEvent) {
38
+ const mods = [];
39
+ if (event.ctrlKey) {
40
+ mods.push('ctrl');
41
+ }
42
+ if (event.altKey) {
43
+ mods.push('alt');
44
45
+ if (event.shiftKey) {
46
+ mods.push('shift');
47
48
+ if (event.metaKey) {
49
+ mods.push('meta');
50
51
+ return mods;
52
+}
0 commit comments