Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(92)

Issue 2055042: Cross-browser shortcut handling through keydown handlers (fixes Esc/CtrlS handling on Chrome) (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 9 months ago by techtonik
Modified:
15 years, 9 months ago
Reviewers:
GvR, guido, james.su, Ilia Mirkin, Andi Albrecht, imirkin
CC:
codereview-discuss_googlegroups.com
Base URL:
http://rietveld.googlecode.com/svn/trunk/
Visibility:
Public.

Description

An extension to http://codereview.appspot.com/2067042/ This adds cross-browser keyboard shortcuts through 'keydown' handlers instead of 'keypress' handlers. This allows to handle special keys like "Esc", "CtrlS" etc. on Chrome, and enables shortcuts even when alternative keyboard layout is active. Test installation is at http://codereview-keydown.appspot.com/

Patch Set 1 #

Patch Set 2 : Handle keys for dashboard pages through 'keydown' #

Patch Set 3 : 'keydown' handler for issue page #

Patch Set 4 : Completely replace 'keypress' handlers with 'keydown' #

Patch Set 5 : Remove keys.html file used for researching key behavior #

Patch Set 6 : Get back missing '{' #

Total comments: 15

Patch Set 7 : Remove focus from textarea on dialog close to resume main keys processing #

Patch Set 8 : Fix Esc for inline comments, stolen focus when draft is invisible. Cleanup #

Patch Set 9 : Add dash for readability, e.g. CtrlS -> Ctrl-S #

Patch Set 10 : Proper fix for 'Esc' handling in comment and message forms #

Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -129 lines) Patch
M static/script.js View 1 2 3 4 5 6 7 8 9 8 chunks +118 lines, -104 lines 0 comments Download
M templates/all.html View 2 3 4 5 6 7 8 9 1 chunk +1 line, -4 lines 0 comments Download
M templates/diff.html View 4 5 6 7 8 9 1 chunk +1 line, -4 lines 0 comments Download
M templates/diff2.html View 4 5 6 7 8 9 1 chunk +1 line, -4 lines 0 comments Download
M templates/issue.html View 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M templates/patch.html View 4 5 6 7 8 9 1 chunk +1 line, -4 lines 0 comments Download
M templates/starred.html View 2 3 4 5 6 7 8 9 1 chunk +1 line, -4 lines 0 comments Download
M templates/user.html View 2 3 4 5 6 7 8 9 1 chunk +1 line, -4 lines 0 comments Download

Messages

Total messages: 26
techtonik
Here is the full keydown handler.
15 years, 9 months ago (2010-08-31 17:21:30 UTC) #1
imirkin_alum.mit.edu
Without going into a detailed review of your change, you end up with stuff like ...
15 years, 9 months ago (2010-08-31 17:33:02 UTC) #2
techtonik
On 2010/08/31 17:33:02, imirkin_alum.mit.edu wrote: > Without going into a detailed review of your change, ...
15 years, 9 months ago (2010-09-01 07:12:27 UTC) #3
guido
On Wed, Sep 1, 2010 at 00:12, <techtonik@gmail.com> wrote: > On 2010/08/31 17:33:02, imirkin_alum.mit.edu wrote: ...
15 years, 9 months ago (2010-09-01 14:25:21 UTC) #4
guido
This seems to work (using a standard US keyboard), and I think I understand what ...
15 years, 9 months ago (2010-09-01 14:36:44 UTC) #5
james.su
As mentioned in techtonik's previous reply, I want to know the preferred way for a ...
15 years, 9 months ago (2010-09-01 20:05:19 UTC) #6
Andi Albrecht
When using a keyboard with German layout it works too. ESC works as expected (Chromium ...
15 years, 9 months ago (2010-09-01 20:09:10 UTC) #7
Ilia Mirkin
I'm not a committer, so I guess you can ignore my comments :) Other than ...
15 years, 9 months ago (2010-09-02 20:06:15 UTC) #8
techtonik
On 2010/09/01 14:36:44, guido wrote: > This seems to work (using a standard US keyboard), ...
15 years, 9 months ago (2010-09-06 20:24:26 UTC) #9
imirkin_alum.mit.edu
On Mon, Sep 6, 2010 at 4:24 PM, <techtonik@gmail.com> wrote: > I hope we talk ...
15 years, 9 months ago (2010-09-06 20:43:40 UTC) #10
techtonik
On 2010/09/01 20:05:19, james.su wrote: > As mentioned in techtonik's previous reply, I want to ...
15 years, 9 months ago (2010-09-06 20:44:33 UTC) #11
imirkin_alum.mit.edu
On Mon, Sep 6, 2010 at 4:44 PM, <techtonik@gmail.com> wrote: > Key 'A' is key ...
15 years, 9 months ago (2010-09-06 20:52:39 UTC) #12
techtonik
On 2010/09/01 20:09:10, Andi Albrecht wrote: > One minor nit is that the document doesn't ...
15 years, 9 months ago (2010-09-07 08:31:15 UTC) #13
techtonik
On 2010/09/06 20:43:40, imirkin_alum.mit.edu wrote: > Talking about inline comments. The check in esc is ...
15 years, 9 months ago (2010-09-07 08:54:19 UTC) #14
techtonik
On 2010/09/06 20:52:39, imirkin_alum.mit.edu wrote: > http://en.wikipedia.org/wiki/AZERTY (zoomed in: > http://en.wikipedia.org/wiki/File:Belgian_pc_keyboard.svg) > > So when ...
15 years, 9 months ago (2010-09-07 09:28:30 UTC) #15
techtonik
Added a check for draftMessage being visible to avoid blurring focus from an active element. ...
15 years, 9 months ago (2010-09-07 11:43:41 UTC) #16
techtonik
All done and ready for review at http://codereview-keydown.appspot.com/ The last changes (patchsets 9 and 10) ...
15 years, 9 months ago (2010-09-08 19:30:37 UTC) #17
Andi Albrecht
Looks good to me. Is this version live somewhere?
15 years, 9 months ago (2010-09-10 07:29:01 UTC) #18
techtonik
On http://codereview-keydown.appspot.com/
15 years, 9 months ago (2010-09-10 09:12:37 UTC) #19
Andi Albrecht
Thanks! It's a bit hard to guess from the review issue what actually happens - ...
15 years, 9 months ago (2010-09-10 09:24:18 UTC) #20
Andi Albrecht
You mention in the description that this is an extension to issue 2067042. Are there ...
15 years, 9 months ago (2010-09-13 10:07:02 UTC) #21
techtonik
It is completely independent in the terms code, so can be applied to current trunk. ...
15 years, 9 months ago (2010-09-13 10:09:53 UTC) #22
Andi Albrecht
techtonik@gmail.com writes: > It is completely independent in the terms code, so can be applied ...
15 years, 9 months ago (2010-09-13 10:24:27 UTC) #23
techtonik
Thanks Ilia for original suggestion. Closing.
15 years, 9 months ago (2010-09-13 15:51:28 UTC) #24
Andi Albrecht
Is this issue related: http://code.google.com/p/rietveld/issues/detail?id=228 (I can't reproduce it, I have no access to MacOS).
15 years, 9 months ago (2010-09-16 03:43:10 UTC) #25
techtonik
15 years, 9 months ago (2010-09-18 14:15:08 UTC) #26
Yes. I couldn't find a key on my keyboard that corresponds to this Meta key in
Windows, so I couldn't get its code. But there is a fix at
http://codereview.appspot.com/2200044/ that should help to stop 'm' processing
when Meta-m (or Cmd-m) is pressed on MacOS.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b