Page MenuHomePhabricator

Create keyboard shortcuts for navigating in ProofreadPage
Open, Needs TriagePublic

Description

I prefer to edit with the keyboard, so shortcuts like "Alt+Shift+E" to edit are valuable. In the Page: namespace used on Wikisources, we don't have shortcuts for navigating pages. I'd like to propose that we 1.) add these and 2.) that they should be "Alf+Shift+→", "Alf+Shift+←", and "Alf+Shift+↑", for navigating forwards one page, backwards one page, and to the index. Thoughts?

An alternate proposal made below is "Alf+Shift+>" and "Alf+Shift+<", to which I would add "Alf+Shift+^". On most QWERTY, Windows-style keyboards, these maps to the following keys: , . 6 (but since you are hitting "Shift" anyway, they would be the characters suggested by Billinghurst).

Event Timeline

Koavf created this task.Feb 5 2018, 4:09 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 5 2018, 4:09 AM

To avoid Musculoskeletal disorders(MSDs), we have to redesign our edit-window with float able buttons. Instead of 3 combination keys, if it is a single key that would be great. To activate, those keys we have to make check box in edit-window itself.

Inductiveload added a subscriber: Inductiveload.EditedFeb 5 2018, 11:07 AM

Also, the forward/back buttons in the top tab bar should probably have rel="next" and rel="prev" attributes on them. This makes the paging explicit, which is generally good practice and also helpful for browser extensions that provide keyboard shortcuts for paging (like Vimperator and friends).

Side note: because the buttons are labelled "Next page" and "Previous page", the paging shortcuts already usually work with the extensions, but can be broken depending on the presence of other links on the page.

key board shortcuts is a must for navigating in wikisource proof read pages. Let's make this happen with common keys for most popular browsers.!!

This is a brilliant idea!

I think the arrow keys sound suitable. Do they clash with anything though? I mean, I know they're not currently activated on Wikisource, but are there other common usages of these combinations, or other extensions that use them? (As far as I can see, there aren't.)

Sadly, I don't think arrow keys can be used as accessKey attributes, so if you do want arrow keys (which seem like a good idea to me), a JS method might be required. For example, this works for me (but the Shift-Alt prefix is not correct on all platforms):

$(document).keypress(function(e) {
  if (e.shiftKey && e.altKey) {
    switch(e.key) {
      case "ArrowLeft":
        $("#ca-proofreadPagePrevLink a")[0].click();
        break;
      case "ArrowRight":
        $("#ca-proofreadPageNextLink a")[0].click();
        break;
      case "ArrowUp":
        $("#ca-proofreadPageIndexLink a")[0].click();
        break;
    }
  }
});

I would have thought that < and > were promising candidates though I hazard a guess that they are not standard on keyboards

Koavf added a comment.EditedFeb 5 2018, 5:29 PM

I think the arrow keys sound suitable. Do they clash with anything though? I mean, I know they're not currently activated on Wikisource, but are there other common usages of these combinations, or other extensions that use them? (As far as I can see, there aren't.)

Both "Alf+Shift+→", "Alf+Shift+←", and "Alf+Shift+↑" and "Alf+Shift+>", "Alf+Shift+<", and "Alf+Shift+^" (building off of Billinghurst) are compatible with the current list at https://meta.wikimedia.org/wiki/Help:Keyboard_shortcuts but on my keyboard, the key for ">" is ".", which goes to your userpage (that is one I use a lot).

Koavf updated the task description. (Show Details)Feb 5 2018, 5:31 PM
Tpt added a subscriber: Tpt.Feb 5 2018, 7:34 PM

I have written a change to add rel=prev and rel=next: https://gerrit.wikimedia.org/r/#/c/408339/

About shortcut links. "Alf+Shift+→", "Alf+Shift+←", and "Alf+Shift+↑" looks fine to me. if there is no concern about them I could do a change to add them in the next few days.

Koavf added a comment.Feb 7 2018, 6:50 AM

Does this mean that it has been added to the MediaWiki codebase: https://integration.wikimedia.org/ci/job/mwext-phpunit-coverage-publish/661/console?

@Koavf: No, that was just this patch for adding rel="prev" and rel="next" to the page links. The shortcut keys will come soon.

Koavf added a comment.Apr 5 2018, 8:47 AM

@Koavf: No, that was just this patch for adding rel="prev" and rel="next" to the page links. The shortcut keys will come soon.

Sam, is there any update on this? I know it's a low priority but I'd like to get an ETA please.