Skip to content

make it possible to disable default keybindings - #8121

Merged
bors-servo merged 1 commit into
servo:masterfrom
paulrouget:disableControls
Oct 22, 2015
Merged

bors-servo merged 1 commit into
servo:masterfrom
paulrouget:disableControls

Conversation

@paulrouget

Copy link
Copy Markdown
Contributor

For browser.html, we want to let the top level webpage handle these keybindings.

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 21, 2015
@jdm

jdm commented Oct 21, 2015

Copy link
Copy Markdown
Member

This feels like an inefficient way to go about this to me. Have you tried adding key listeners to browser.html and calling preventDefault for the bindings you want Servo to ignore?

@jdm jdm added S-awaiting-answer Someone asked a question that requires an answer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 21, 2015
@jdm jdm self-assigned this Oct 21, 2015
@paulrouget

Copy link
Copy Markdown
Contributor Author

This feels like an inefficient way to go about this to me. Have you tried adding key listeners to browser.html and calling preventDefault for the bindings you want Servo to ignore?

Aren't DOM events not even created at this point?

Should we propagate the events and later on check if preventDefault was called?

Also - is zooming with ctrl-scroll really a thing we need?

@jdm

jdm commented Oct 21, 2015

Copy link
Copy Markdown
Member

We prevent backspace from navigating the page when a text input is focused on a page; all key events are first sent to the focused script task, processed, and if they're not prevented they're returned to the compositor for further processing. I would be ok with removing zooming via the mousewheel if it makes your life easier.

@paulrouget

Copy link
Copy Markdown
Contributor Author

We prevent backspace from navigating the page when a text input is focused on a page; all key events are first sent to the focused script task, processed, and if they're not prevented they're returned to the compositor for further processing

I see. What about escape?

@paulrouget

Copy link
Copy Markdown
Contributor Author

If we can preventDefault() the quit-on-escape-key behavior and remove the ctrl-scroll binding, that would be enough for me.

I'll look at how to do that.

@jdm

jdm commented Oct 21, 2015

Copy link
Copy Markdown
Member

That would require updating http://mxr.mozilla.org/servo/source/ports/glutin/window.rs#173 to match the others, and ensuring that handle_key has a way to indicate that the app should exit.

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-answer Someone asked a question that requires an answer. labels Oct 21, 2015
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Oct 22, 2015
@jdm

jdm commented Oct 22, 2015

Copy link
Copy Markdown
Member

@bors-servo: r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit e60f02c has been approved by jdm

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 22, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit e60f02c with merge 0d4641b...

bors-servo pushed a commit that referenced this pull request Oct 22, 2015
make it possible to disable default keybindings

For browser.html, we want to let the top level webpage handle these keybindings.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8121)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt

@bors-servo
bors-servo merged commit e60f02c into servo:master Oct 22, 2015
mrobinson added a commit to mrobinson/servo that referenced this pull request Oct 27, 2015
Synthesized pinch zoom was removed in servo#8121 so that this combination of
mouse wheel and key press can be handled by the page. I mistakenly
re-implemented it servo#8215. In order to preserve synthesized pinch zoom,
which is very useful for testing on desktop computers, have it work
similarly to page zoom except with the ALT key pressed.
mrobinson added a commit to mrobinson/servo that referenced this pull request Oct 27, 2015
Synthesized pinch zoom was removed in servo#8121 so that this combination of
mouse wheel and key press can be handled by the page. I mistakenly
re-implemented it servo#8215. In order to preserve synthesized pinch zoom,
which is very useful for testing on desktop computers, have it work
similarly to page zoom except with the ALT key pressed.
bors-servo pushed a commit that referenced this pull request Oct 27, 2015
Make executing synthesized pinch zoom more similar to zoom

Synthesized pinch zoom was removed in #8121 so that this combination of
mouse wheel and key press can be handled by the page. I mistakenly
re-implemented it #8215. In order to preserve synthesized pinch zoom,
which is very useful for testing on desktop computers, have it work
similarly to page zoom except with the ALT key pressed.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8223)
<!-- Reviewable:end -->
mrobinson added a commit to mrobinson/servo that referenced this pull request Oct 27, 2015
Synthesized pinch zoom was removed in servo#8121 so that this combination of
mouse wheel and key press can be handled by the page. I mistakenly
re-implemented it servo#8215. In order to preserve synthesized pinch zoom,
which is very useful for testing on desktop computers, have it work
similarly to page zoom except with the ALT key pressed.
bors-servo pushed a commit that referenced this pull request Nov 3, 2015
Make executing synthesized pinch zoom more similar to zoom

Synthesized pinch zoom was removed in #8121 so that this combination of
mouse wheel and key press can be handled by the page. I mistakenly
re-implemented it #8215. In order to preserve synthesized pinch zoom,
which is very useful for testing on desktop computers, have it work
similarly to page zoom except with the ALT key pressed.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8223)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this pull request Nov 3, 2015
Make executing synthesized pinch zoom more similar to zoom

Synthesized pinch zoom was removed in #8121 so that this combination of
mouse wheel and key press can be handled by the page. I mistakenly
re-implemented it #8215. In order to preserve synthesized pinch zoom,
which is very useful for testing on desktop computers, have it work
similarly to page zoom except with the ALT key pressed.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8223)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants