Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions js/lib/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export class RemoteFrameBufferView extends DOMWidgetView {
// Defines how the widget gets rendered into the DOM
render() {
var that = this;
console.log("We cooking now bro")

// Create a stub element that can grab focus
this.focus_el = document.createElement("a");
Expand Down Expand Up @@ -264,6 +265,16 @@ export class RemoteFrameBufferView extends DOMWidgetView {
let event = create_pointer_event(that.img, e, that._pointers, 'pointer_move');
that.send_throttled(event, 20);
});
this.img.addEventListener('pointerenter', function (e) {
// TODO: Do we want to edit this._pointers?
let event = create_pointer_event(that.img, e, {[e.pointerId]: e}, 'pointer_enter');
that.send(event);
});
this.img.addEventListener('pointerleave', function (e) {
// TODO: Do we want to edit this._pointers?
let event = create_pointer_event(that.img, e, {[e.pointerId]: e}, 'pointer_leave');
that.send(event);
});

// Click events are not pointer events. Not sure if we need click events. It seems to make
// less sense, because the img is just a single element. Only double-click for now.
Expand Down
8 changes: 8 additions & 0 deletions jupyter_rfb/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@
This event has the same keys as the pointer down event.
This event is throttled.

* **pointer_enter**: emitted when the user moves a pointer into the
boundary of the widget.
This event has no additional keys.

* **pointer_leave**: emitted when the user moves a pointer out of the
boundary of the widget.
This event has no additional keys.

* **double_click**: emitted on a double-click.
This event looks like a pointer event, but without the touches.

Expand Down