Skip to content

More consistent events #185

@almarklein

Description

@almarklein

I would like to make the event spec more precise, to realize more consistent behavior across backends.

  • Mouse capture behavior.
  • Button capture:
    • no new pointer_down as long as current one not released.
    • release when all buttons are released.
    • move and up event have same button as start-button.
  • Add a click event in addition to double_click (consistency).
  • Discourage the alt-key, leave for the host system.
  • Throttling best practices.
  • Key down should not repeat.
  • ... adding as I go

Other topics:

  • Proper char events to enable text editing, also for e.g. Japanese.
  • Pointer behavior when using touch device.
  • Touch events.

For future reference

Old code for touches that was in jupyter_rfb for a while:

  let touches = {};
  let ntouches = 0;
  for (let pointer_id in pointers) {
      let pe = pointers[pointer_id]; * pointer event
      let x = Number(pe.clientX - offset[0]);
      let y = Number(pe.clientY - offset[1]);
      let touch = { x: x, y: y, pressure: pe.pressure };
      touches[pe.pointerId] = touch;
      ntouches += 1;
  }

Old suggestion from a comment in jupyter_rfb for improved char events:

  if (event.key == "Backspace") {
      let char_event = {
          event_type: 'char',
          data: null,
          is_composing: false,
          input_type: "deleteBackwards",
          repeat: e.repeat,
          time_stamp: get_time_stamp(),
      };
      this.send(char_event);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions