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.
2 parents 92ad7e5 + 0d12cad commit 6246018Copy full SHA for 6246018
src/mpl_widget.ts
@@ -759,6 +759,7 @@ export class MPLCanvasView extends DOMWidgetView {
759
y: y,
760
button: event.button,
761
step: event.step,
762
+ modifiers: utils.getModifiers(event),
763
guiEvent: utils.get_simple_keys(event),
764
});
765
};
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