File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes simulate shift key Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "simulate shift key" Watch "simulate shift key" New topic
Author

simulate shift key

seb petterson
Ranch Hand

Joined: Mar 04, 2005
Posts: 118
I am trying to implement navigation with arrowkeys in a "grid". The grid is a table containing input fields. The vertical navigation with up and down arrows I got working through giving the input fields id values that increment downwards like this:
0 3 6
1 4 7
2 5 8
Plus with a bit of javascripting.
Now I need to be able to navigate horisontally.
the problem is that the table is generated dynamically so I can't know how many rows or how many columns there are. And I also dont know if the number of cells in each row might different from the number of input fields.
So: my idea was to emulate tabbing! It works fine with the right arrow, when its pressed i execute:

And the browser behaves as if the TAB key was pressed
The problem I have is with the left key, which would be SHIFT+TAB. How do I emulate that??

I allreayd tried:


But id didnt work
Thanks.

Seb
[ April 11, 2006: Message edited by: seb petterson ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Just to let you know IE is the only browser that lets you set the keycode so you are not going to be able to use this in any other browser.

Eric
 
wood burning stoves
 
subject: simulate shift key
 
Similar Threads
Handle shift+Tab key event
Problem With Ctrl C/V in Firefox after validating an input
how to create small windows
Form submittal problem
how do I access the onKeyPress value?