Skip to content

Cannot use any keybindings inside webview #61762

Closed

Description

@Tyriar
  1. Open release notes
  2. Use some keybinding (ctrl+,, ctrl+k, etc.), nothing seems to work

Activity

  1. added
    bug
    electron
    electron-blocker
    on Oct 24, 2018
  2. bpasero commented on Oct 25, 2018

    @bpasero
    Contributor

    Daniel Imms (@Tyriar) is that on macOS? I cannot reproduce but there is a high probability that the code I added here can cause issues, e.g. for chords.

    Bottom line is that the webview element is entirely different with Electron 3.0.x (changed to an out of process iframe), as such DOM events are no longer dispatched from inside to the outside.

    It would be great if you guys could take this for November, because I am out on vacation for 2.5 weeks starting next week. Moving to November.

  3. Tyriar commented on Oct 26, 2018

    @Tyriar
    ContributorAuthor

    This was on Windows 10

  4. bpasero commented on Oct 26, 2018

    @bpasero
    Contributor

    Ok, I was testing only macOS.

  5. bpasero commented on Oct 27, 2018

    @bpasero
    Contributor

    Daniel Imms (@Tyriar) I cannot reproduce, in this video I can open settings (Ctrl+,) and quick open (Ctrl+P):

    before

  6. bpasero commented on Dec 1, 2018

    @bpasero
    Contributor
  7. Tyriar commented on Dec 3, 2018

    @Tyriar
    ContributorAuthor

    I can still reproduce, I notice you're using the OSS build over the exploration, maybe that's it? Build details:

    VS Code version: Code - Exploration 1.30.0-exploration (57d85c2, 2018-12-01T13:59:00.436Z)
    OS version: Windows_NT x64 10.0.18290

    System Info
    Item Value
    CPUs Intel(R) Xeon(R) CPU E5-1620 v4 @ 3.50GHz (8 x 3492)
    GPU Status 2d_canvas: enabled
    checker_imaging: disabled_off
    flash_3d: enabled
    flash_stage3d: enabled
    flash_stage3d_baseline: enabled
    gpu_compositing: enabled
    multiple_raster_threads: enabled_on
    native_gpu_memory_buffers: disabled_software
    rasterization: unavailable_off
    surface_synchronization: enabled_on
    video_decode: enabled
    webgl: enabled
    webgl2: enabled
    Memory (System) 63.92GB (54.26GB free)
    Process Argv
    Screen Reader no
    VM 0%
    Extensions (7)
    Extension Author (truncated) Version
    tslint eg2 1.0.40
    vscode-npm-script eg2 0.3.5
    git-project-manager fel 1.7.1
    vscode-pull-request-github Git 0.3.0
    cpptools ms- 0.20.1
    material-icon-theme PKi 3.6.1
    vscode-todo-highlight way 1.0.4

    (1 theme extensions excluded)

    image

  8. bpasero commented on Dec 3, 2018

    @bpasero
    Contributor

    I can reproduce from my Windows box, maybe it was a Parallels issue.

    Matt Bierner (@mjbvz) did you have time to look into this?

  9. bpasero commented on Dec 3, 2018

    @bpasero
    Contributor
  10. bpasero commented on Dec 3, 2018

    @bpasero
    Contributor

    Ok, it ends up being ignored here:

    https://github.com/Microsoft/vscode/blob/57d85c2667e8e66140e0f7edfb8b6e636c6a4876/src/vs/platform/keybinding/common/abstractKeybindingService.ts#L170

    Which indicates that the way we emulate the keyboard event is not good enough on Windows at least to be treated like a real keypress. I will need to consult with alexandrudima how to produce a "fake" keyboard event that can be dispatched properly.

  11. bpasero commented on Dec 4, 2018

    @bpasero
    Contributor

    I think a better solution (that I just verified works on Windows) is to listen on the actual keyboard event in the webview and serialize that one over to the renderer to dispatch to the keybinding service. It looks like one property is missing from Electron's before-input-event that causes us to ignore the keyboard event. The property is keyCode.

  12. bpasero commented on Dec 5, 2018

    @bpasero
    Contributor

    Fixed via 42cde7e

  13. locked and limited conversation to collaborators on Jan 19, 2019
  14. Tyriar commented on Jan 31, 2019

    @Tyriar
    ContributorAuthor

    Verified on windows, linux and mac

  15. added
    verified
    on Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugelectronelectron-blockerverified

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions