Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7501489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:33:08+00:00 2026-05-29T20:33:08+00:00

I made a page for a windows CE with a two dimentional navigation using

  • 0

I made a page for a windows CE with a two dimentional navigation using tabIndex. at first I just wanted to use tabIndex as a reference for the next focus.

because this application is for a portable device, doing it like this is very demanding on the handheld and very time consuming when comparing to a simple tab and shift+tab.

I have a function to process the onkeydown for my up arrow and down arrow,
for my downarrow, the code is simple

if(specialMove == 0){all this does is checks that the tab isn’t leaving the page.

event.keyCode=9; return;}

the problem is my uparrow, I want it to return a SHIFT+TAB to navigate upwards, I found this snipet of jQuery code but I’m having a problem making it work.

if(specialMove == 0){
    $('body').trigger(JQuery.Event('keydown', {keyCode:9, shiftKey: true}));
    return;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:33:10+00:00Added an answer on May 29, 2026 at 8:33 pm

    Trigger only calls the event handlers defined on the body in this case. It does not send the key codes to the browser. See: http://api.jquery.com/trigger/. In short, it only executes the code that jQuery knows of that would be executed in case of a keydown event. It ‘simulates’ a keydown event.

    Sending key events to the browser is not possible as far as I know, as this poses some serious security risks. You’ll have to implement selecting the next and previous element in Javascript.

    EDIT:
    You could try something like:

    $(function() {
      var navigationElements = $('[tabIndex]').sort(function(a,b) {
        return $(a).attr('tabindex') - $(b).attr('tabindex');
      });
    
      // We don't know if the users presses the up or down button first
      // so we initialize as null and let the event handle the first element
      var currentIndex = null;
    
      // On event:
      if (currentIndex != null && currentIndex < navigationElements.length - 1) {
        navigationElements[++currentIndex].focus();
      } else {
        currentIndex = 0;
        navigationElements[currentIndex].focus();
      }
    
      // and:
      if (currentIndex != null && currentIndex > 0) {
        navigationElements[--currentIndex].focus();
      } else {
        currentIndex = navigationElements.length - 1;
        navigationElements[currentIndex].focus();
      }
    });
    

    This is untested, unoptimized code, so there probably is a much better solution but this would work pretty fast even on slow browsers. It does not take into account focus changes that do not go through your events, so you’d have to add onfocus events to set the currentIndex to the element that was lastly selected by the user.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a page in which i m using a list to display
Is it possible to intercept every request made from a page using javascript? i.e.
I made a report using crystal report and in the page load I am
I am using Doxygen 1.7.4 for Windows. In the File List page of generated
I made application in windows phone (Using Windows Phone SDK 7.1 /C#). But am
I made a page, 3 cols, tableless and css formated (as it should be).
I have to made a page which will send Email to Newsletter subscribers. There
I made a new page in our website that needs to access some functions
i made an HTML page with all widths and heights as percentage that's primary
Is there a way to access the http request IE made when the page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.