Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8b24a30

Browse files
committed
Add the originalEvent info
1 parent a89ec04 commit 8b24a30

File tree

1 file changed

+8
-2
lines changed
  • lib/matplotlib/backends/web_backend

1 file changed

+8
-2
lines changed

lib/matplotlib/backends/web_backend/mpl.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,12 @@ mpl.figure.prototype.mouse_event = function(event, name) {
477477

478478
var x = canvas_pos.x;
479479
var y = canvas_pos.y;
480+
var guiEvent = simpleKeys(event);
480481

482+
guiEvent.originalEvent = simpleKeys(event.originalEvent);
481483
this.send_message(name, {x: x, y: y, button: event.button,
482484
step: event.step,
483-
guiEvent: simpleKeys(event)});
485+
guiEvent: guiEvent});
484486

485487
/* This prevents the web browser from automatically changing to
486488
* the text insertion cursor when the button is pressed. We want
@@ -520,8 +522,12 @@ mpl.figure.prototype.key_event = function(event, name) {
520522

521523
this._key_event_extra(event, name);
522524

525+
var guiEvent = simpleKeys(event);
526+
527+
guiEvent.originalEvent = simpleKeys(event.originalEvent);
528+
523529
this.send_message(name, {key: value,
524-
guiEvent: simpleKeys(event)});
530+
guiEvent: guiEvent});
525531
return false;
526532
}
527533

0 commit comments

Comments
 (0)