Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to cancel the element picker with keyboard?

14 views
Skip to first unread message

Xue Fuqiao

unread,
Oct 8, 2016, 1:34:09 AM10/8/16
to dev-developer-tools
Hi list,

I'd like to cancel the "pick an element from the page" action with
keyboard. After searching, I found the following comment in
server/actors/highlighters.js[1]:

/* ESC/CTRL+SHIFT+C: Cancels picker, picks currentNode */

But pressing esc only toggles the split console, and 'cmd/control +
shift + c' doesn't work either (nothing happens). Any idea why?


OS: macOS 10.12
Browsers tried: Firefox 49.0.1 and 52.0a1
(49fe455cac957808ed4a5d1685c3a1938dac1d31)

[1] https://dxr.mozilla.org/mozilla-central/rev/49fe455cac957808ed4a5d1685c3a1938dac1d31/devtools/server/actors/highlighters.js#294

Tim Nguyen

unread,
Oct 8, 2016, 5:01:18 PM10/8/16
to mozilla-dev-d...@lists.mozilla.org
Alt+Cmd+C toggles on/off the element picker for me.

Xue Fuqiao

unread,
Oct 8, 2016, 7:03:52 PM10/8/16
to Tim Nguyen, mozilla-dev-d...@lists.mozilla.org
On Sun, Oct 9, 2016 at 5:01 AM, Tim Nguyen <nti...@gmail.com> wrote:

Hi Tim,

> On Saturday, October 8, 2016 at 6:34:09 AM UTC+1, Xue Fuqiao wrote:
>> I'd like to cancel the "pick an element from the page" action with
>> keyboard. After searching, I found the following comment in
>> server/actors/highlighters.js[1]:
>>
>> /* ESC/CTRL+SHIFT+C: Cancels picker, picks currentNode */
>>
>> But pressing esc only toggles the split console, and 'cmd/control +
>> shift + c' doesn't work either (nothing happens). Any idea why?
>>
>> OS: macOS 10.12
>> Browsers tried: Firefox 49.0.1 and 52.0a1
>>
It works for me. Thanks. Do you have any idea why esc doesn't work? In
devtools/server/actors/highlighters.js:

this._onKey = event => {
[...]
switch (event.keyCode) {
[...]
// Cancel pick mode.
case Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE:
this.cancelPick();
events.emit(this._walker, "picker-node-canceled");
return;
[...]

The code looks good to me. Why/How does the split console capture this event?

Patrick Brosset

unread,
Oct 10, 2016, 3:11:19 AM10/10/16
to Xue Fuqiao, dev-developer-tools
Ctrl+Shift+C works for me (tested on windows FF51). Could you file a bug if
it doesn't for you?
https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox&component=Developer%20Tools%3A%20Inspector
Escape indeed doesn't work, I think Greg Tatum was working on fixing this,
although I can't remember which bug he was doing the work in (the problem
is that the content window doesn't receive focus, so escape is handled by
the toolbox, which is why the split console opens up).

On Sat, Oct 8, 2016 at 7:33 AM, Xue Fuqiao <xfq....@gmail.com> wrote:

> Hi list,
>
> I'd like to cancel the "pick an element from the page" action with
> keyboard. After searching, I found the following comment in
> server/actors/highlighters.js[1]:
>
> /* ESC/CTRL+SHIFT+C: Cancels picker, picks currentNode */
>
> But pressing esc only toggles the split console, and 'cmd/control +
> shift + c' doesn't work either (nothing happens). Any idea why?
>
>
> OS: macOS 10.12
> Browsers tried: Firefox 49.0.1 and 52.0a1
> (49fe455cac957808ed4a5d1685c3a1938dac1d31)
>
> [1] https://dxr.mozilla.org/mozilla-central/rev/
> 49fe455cac957808ed4a5d1685c3a1938dac1d31/devtools/server/
> actors/highlighters.js#294
> _______________________________________________
> dev-developer-tools mailing list
> dev-devel...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-developer-tools
>

Xue Fuqiao

unread,
Oct 10, 2016, 5:01:32 AM10/10/16
to Patrick Brosset, dev-developer-tools
On Mon, Oct 10, 2016 at 3:11 PM, Patrick Brosset <pbro...@mozilla.com> wrote:

Hi Patrick,

> Ctrl+Shift+C works for me (tested on windows FF51). Could you file a bug if
> it doesn't for you?
> https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox&component=Developer%20Tools%3A%20Inspector

As Tim said, in macOS, cmd+option+c should be used (and it works for
me). So there is no need for the bug report.

> Escape indeed doesn't work, I think Greg Tatum was working on fixing this,
> although I can't remember which bug he was doing the work in (the problem is
> that the content window doesn't receive focus, so escape is handled by the
> toolbox, which is why the split console opens up).

I see. Thank you!

Greg Tatum

unread,
Oct 10, 2016, 9:40:58 AM10/10/16
to Xue Fuqiao, dev-developer-tools, Patrick Brosset
Yes, this is a focus issue when the toolbar is docked. I'm working on this
here: https://bugzilla.mozilla.org/show_bug.cgi?id=1224304
0 new messages