Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You would definitely need to use JavaScript to capture all of the <strong>keydown</strong> (note, arrow keys will not fire <strong>keypress</strong> event) events. For instance, <kbd>Ctrl</kbd> + <kbd>2</kbd> would go to the /2 page, <kbd>Ctrl</kbd> + <kbd>3</kbd> would go to the /3 page.</p> <p>I think you'd need a way to map the keypress events to the actual page names. I'd suggest maintaining a layer of abstraction, such as a mapping file, between keydown event codes and the actual page names so that the keycodes could be customized in the future if needed.</p> <p>Do a search on this event to get you started. The example below captures the enter key</p> <pre class="lang-js prettyprint-override"><code> if(event.keyCode == 13) { // do stuff } </code></pre> <p>Here is the list of keycodes: <a href="http://www.cambiaresearch.com/c4/702b8cd1-e5b0-42e6-83ac-25f0306e3e25/Javascript-Char-Codes-Key-Codes.aspx" rel="nofollow">http://www.cambiaresearch.com/c4/702b8cd1-e5b0-42e6-83ac-25f0306e3e25/Javascript-Char-Codes-Key-Codes.aspx</a></p> <p>To create events for these keys, I would suggest starting out by creating events for them. You will need jQuery for this example, although there are ways to accomplish the same in pure JavaScript:</p> <pre class="lang-js prettyprint-override"><code>// bind keydown events to the window $(document).keydown(function(event) { if (event.which == 37) { // left arrow - run your code to change back a page alert('left'); } else if(event.which == '39') { // right arrow - run code to move forward a page alert('right'); } }); </code></pre> <p>Table of key events by browser and keys: <a href="http://www.quirksmode.org/js/keys.html" rel="nofollow">http://www.quirksmode.org/js/keys.html</a></p> <p>List of key codes: <a href="http://www.cambiaresearch.com/c4/702b8cd1-e5b0-42e6-83ac-25f0306e3e25/Javascript-Char-Codes-Key-Codes.aspx" rel="nofollow">http://www.cambiaresearch.com/c4/702b8cd1-e5b0-42e6-83ac-25f0306e3e25/Javascript-Char-Codes-Key-Codes.aspx</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload