New issue
Advanced search Search tips

Issue 722718 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature



Sign in to add a comment

hterm: improve keyboard binding docs

Project Member Reported by vapier@chromium.org, May 16 2017

Issue description

our keyboard binding documentation requires people to read the source and experiment quite a bit.  we should really polish this and add plenty of examples.
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/9837fff5c57e251934b0d7273645addadebad8af

commit 9837fff5c57e251934b0d7273645addadebad8af
Author: Mike Frysinger <vapier@chromium.org>
Date: Tue May 30 20:24:38 2017

hterm: make keybinding parsing more resilient to user inputs

The "in" keyword in JS is a messy beast.  Most people expect it to only
match entries in a dict they've added, but it also matches all members
of objects they've inherited (including Object).  That means a binding
like "__proto__-A" or "toString-B" will pass the parser, but throw weird
errors later on as we try to execute the keys.

Leverage the hasOwnProperty helper to avoid these sort of errors.

BUG= chromium:722718 

Change-Id: Icd359b00ff6ad1777520811ed576c9b4eee5cef1
Reviewed-on: https://chromium-review.googlesource.com/516746
Reviewed-by: Brandon Gilmore <varz@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/9837fff5c57e251934b0d7273645addadebad8af/hterm/js/hterm_parser.js
[modify] https://crrev.com/9837fff5c57e251934b0d7273645addadebad8af/hterm/js/hterm_parser_tests.js

Project Member

Comment 3 by bugdroid1@chromium.org, May 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/e672167a2a56288f31e538a564d11d31f1d04197

commit e672167a2a56288f31e538a564d11d31f1d04197
Author: Mike Frysinger <vapier@chromium.org>
Date: Tue May 30 20:25:18 2017

hterm: make keybindings more flexible

There's no good reason to require exact capitalization with keys in
most cases.  We don't differentiate between "Ctrl" or "CTRL", so let
users roll with either by normalizing user inputs to uppercase.

One could make an argument about confusing "A", "a", "Shift-a", and
"Shift-A", but we already have that to some degree today with just
"A" and "Shift-A".  The benefits for other keys are outweighed imo
as requiring people to always write in uppercaps is not natural when
we require the modifiers to be mixed caps.  e.g. Ctrl-SPACE is OK,
but CTRL-Space is invalid?

We also add aliases for a lot of keys with longer names.  Many of
these keys don't have dominant forms, so accept e.g. Escape and Esc.

BUG= chromium:722718 

Change-Id: Ib80a2b65f01fab2fbbe100c53deb61e9217b9358
Reviewed-on: https://chromium-review.googlesource.com/516747
Reviewed-by: Brandon Gilmore <varz@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/e672167a2a56288f31e538a564d11d31f1d04197/hterm/js/hterm_parser.js
[modify] https://crrev.com/e672167a2a56288f31e538a564d11d31f1d04197/hterm/doc/KeyboardBindings.md
[modify] https://crrev.com/e672167a2a56288f31e538a564d11d31f1d04197/hterm/js/hterm_parser_identifiers.js
[modify] https://crrev.com/e672167a2a56288f31e538a564d11d31f1d04197/hterm/js/hterm_parser_tests.js

Comment 4 by vapier@chromium.org, May 30 2017

Owner: vapier@chromium.org
Status: Fixed (was: Available)
i plan on improving the options page parser, but i'll do that under issue 718670

Sign in to add a comment