[JS] Tab key event (ScriptUI)

Hi,
If set to 'window' or 'palette' type, a ScriptUI Window can't receive 'Tab' key events on WinXP.
Is this the same with other OS?
Is there a workaround?
Thanks,
Marc

Here's the thread about the bug
http://forums.adobe.com/message/2068532
It really was and is a big problem for me and soesn't seem to be getting fixed any time soon
Steven Bryant
http://scriptui.com

Similar Messages

  • Listening Tab Key Event On JTextField

    Hi
    i am unable to listen Tab Key Event on JTextField ....
    tField.addKeyListener(new KeyAdapter()
    public void keyPressed(KeyEvent e)
    if (e.getKeyCode()==e.VK_TAB)
    JOptionPane.showMessageDialog(null,"Tab Pressed");
    else
    JOptionPane.showMessageDialog(null,"Tab Not Pressed");
    When i pressed Tab Key then it dont come in KeyPressed Event ...Actually it go towards next FocusAble component ..
    Any help in this regard.....

    I also Checked it by using
    tField..setFocusTraversalKeysEnabled(false);
    tField.addKeyListener(new KeyAdapter()
    public void keyPressed(KeyEvent e)
    if (e.getKeyCode()==e.VK_TAB)
    JOptionPane.showMessageDialog(null,"Tab Pressed");
    else
    JOptionPane.showMessageDialog(null,"Tab Not Pressed");
    In this case each time e.getKeyCode() returns 0...
    plz help me

  • Capturing the TAB key event.

    How can I capture the TAB key event?
    I am trying to use it within a JTextField to do a normal text tab operation.
    Thanks,
    D

    I want to map the Tab key to a jTextField so that when the user is editing inside the jTextField they can press the TAB key to tab over a predefined number of characters.
    Thanks,
    D

  • Tab key event not fired in JTabbedPane

    Hello,
    I wanted to add the functionality of moving between tabs when Ctrl+Tab is pressed like Windows tabs.
    But the tab key listener event is not getting fired by pressing Tab. For all the other key pushes it is working good. It this a problem with Java? Any workarounds?
    Here is the sample code:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TestTab extends JFrame
         public void drawGUI()
              //getContentPane().setLayout(new GridLayout(1, 1));
              JTabbedPane lTabbedPane = new JTabbedPane();
              JPanel lFirstPanel = new JPanel();
              lFirstPanel.add(new JLabel("First Panel"));;
              JPanel lSecondPanel = new JPanel();
              lSecondPanel.add(new JLabel("Second Panel"));;
              lTabbedPane.addTab("Tab1", null, lFirstPanel, "Does nothing");
              lTabbedPane.addTab("Tab1", null,lSecondPanel, "Does nothing");
              getContentPane().add(lTabbedPane);
              lTabbedPane.addKeyListener(new KeyAdapter()
                   public void keyPressed(KeyEvent lKeyEvent)
                        System.out.println(lKeyEvent.getKeyText(lKeyEvent.getKeyCode()));
              setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
         public static void main(String[] args)
              TestTab lTestTab = new TestTab();
              lTestTab.drawGUI();
              lTestTab.setSize(200, 200);
              lTestTab.setVisible(true);

    The KeyPressed events for TAB and CTRL-TAB are typically consumed by the KeyboardFocusManager for component traversal. What you have to do is adjust traversal keys and add CTRL-TAB as an action of your JTabbedPane. This is usually done with the InputMap/ActionMap, not a KeyListener:
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    public class X {
        public static void main(String[] args) {
            Set tabSet = Collections.singleton(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0));
            KeyStroke ctrlTab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.CTRL_DOWN_MASK);
            final int FORWARD = KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS;
            final JTabbedPane tp = new JTabbedPane();
            //setFocusTraversalKeys to remove ctrl-tab as a forward gesture
            tp.setFocusTraversalKeys(FORWARD, tabSet);
            for (int i=0; i<6; ++i) {
                JPanel p = new JPanel(new GridLayout(0,1));
                JTextArea area = new JTextArea();
                area.setFocusTraversalKeys(FORWARD, Collections.EMPTY_SET);
                p.add(new JScrollPane(area));
                area = new JTextArea();
                area.setFocusTraversalKeys(FORWARD, Collections.EMPTY_SET);
                p.add(new JScrollPane(area));
                tp.addTab("tab " + i,p);
            //add ctrlTab as an action to move to next tab
            Action nextTab = new AbstractAction("nextTab") {
                public void actionPerformed(ActionEvent evt) {
                    int idx = tp.getSelectedIndex();
                    if (idx != -1) {
                        idx = (idx + 1) % tp.getTabCount();
                        tp.requestFocusInWindow();
                        tp.setSelectedIndex(idx);
            InputMap im = tp.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
            im.put(ctrlTab, nextTab.getValue(Action.NAME));
            tp.getActionMap().put(nextTab.getValue(Action.NAME), nextTab);
            JFrame f= new JFrame("X");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(tp);
            f.setSize(400,300);
            f.setVisible(true);
    [/code[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Shift+Tab Key Event

    Hallo all,
    I have a big problem ;) I am having JTables and these Jtables must lose their focus when someone clicks on Shift+TAB at the (0,0) th of its cell. I tried to do it in a key event but it doesn't accept my solution. Here is a code chunk:
    AWTEvent currentEvent = EventQueue.getCurrentEvent();
    if( currentEvent instanceof KeyEvent)
            KeyEvent ke = (KeyEvent)currentEvent;
                if(ke.getSource()!=this)
                    return;
                if(rowIndex==getModel().getRowCount()-1 && columnIndex==getModel().getColumnCount()-1
                        && KeyStroke.getKeyStrokeForEvent(ke).equals(shiftTabKeyStroke)){
                    KeyboardFocusManager.getCurrentKeyboardFocusManager().focusPreviousComponent();
                    return;
                }So when I compile it, it makes a return to its 0,0 th cell instead of giving focus on the previous component.

    DB means to say this.
    AWTEvent currentEvent = EventQueue.getCurrentEvent();
    if( currentEvent instanceof KeyEvent)
            KeyEvent ke = (KeyEvent)currentEvent;
                if(ke.getSource()!=this)
                    return;
                if(rowIndex==getModel().getRowCount()-1 && columnIndex==getModel().getColumnCount()-1
                        && KeyStroke.getKeyStrokeForEvent(ke).equals(shiftTabKeyStroke)){
                      SwingUtilities.invokeLater(new Runnable(){
                          public void run()
                                 KeyboardFocusManager.getCurrentKeyboardFocusManager().focusPreviousComponent();                         
                    return;
                }

  • How to handle Shift+Tab key event

    HI,
    This is Ramesh.I have added KeyListener to JTable. I am handling key events through key codes. But I am
    unable to handling multiple key strokes like Shift+Tab
    Can any one please give me suggestion how can I do it
    Thanks & Regards
    Ramesh K

    i dont know about Key BindingsWhich is why you where given a link to the tutorial in the first response.
    can you please give me suggestion.You've been given the suggestion 3 times. You can decide to learn to write code the way other Swing components are written. Or, you can do it the old way. The choice is up to you.

  • Removing all tab key events

    Hallo all,
    I am having another problem with my JTables. Because our customer doesn't want to get out of JTable via Ctrl+TAB we have customized the TAB Key behaviour and it skips to the following component and it is fine. But if I go to a cell via TAB key (for example cell(3,4)) and if I select another component above via mouse button and go through the table via TAB key it focuses on the cell (4,4) instead of cell(0,0). How can I solve this problem? How can I refresh or remove the key listeners of the Table after I left the table via mouse? Can anyone help me?

    (Untested, and there may be a better approach)
    I would try adding a FocusListener and in the focusLost, something liketable.getSelectionModel().clearSelection();
    table.getColumnModel().getSelectionModel().clearSelection();luck, db
    edit No that didin't do it. Try this one:table.setRowSelectionInterval(0, 0);
    table.setColumnSelectionInterval(0, 0);Edited by: Darryl.Burke

  • How to make the TAB Key Event called

    Hi ,
    I want to make the tab key called twice when I hit on a button. It should jump to the next 2 cell.
    Thanks.
    DT

    Here's a couple related threads
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=583877
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=712386
    I'd also suggest exploring the Search Forums available on the left,
    which is how I found those threads:
    http://onesearch.sun.com/search/onesearch/index.jsp?qt=focus+traversal+tab+text&subCat=siteforumid%3Ajava57&site=dev&dftab=siteforumid%3Ajava57&chooseCat=javaall&col=developer-forums

  • Handling keyTyped events in JTable for TAB key

    In my app, I have a JTable. Some columns are non-editable.
    I have attached a keyListener to the table and have overridden keyTyped() and keyReleased() methods.
    In keyReleased(), I do something depending on the key code. For example: if its the VK_DELETE, I delete the row. If its some other user configured key, then I show a popup dialog where the user can enter some data, etc...
    In keyTyped(), I first check if the column is one of the specific columns. Then I get the keyChar. After this, I show a dialog and pre-populate a JTextField on this dialog with that keyChar.
    My issue is that 'TAB' key events arrive in keyTyped() and not in keyReleased(). As a result, the dialog is shown and the tab takes place inside the JTextfield which is incorrect.
    I would like to ignore TAB keyTyped events. When I look up the keyCode in keyTyped() method, it is 0. So there is no way for me to tell what key was typed.
    How can I ignore TAB events in my keyTyped() method?
    thx

    I now do the following to determine if TAB key has been typed
    public void keyTyped(KeyEvent e) {
    char c = e.getKeyChar();
    if (c == KeyEvent.VK_TAB) {
    Is this correct ?
    Edited by: tsc on Sep 28, 2007 12:40 PM

  • How to alter behaviour of pressing enter key to tab key?

    Hi! I want to alter the behaviour when pressing the enter key so it acts like pressing the tab key in a JTextField. That is pressing the enter key will transfer the cursor to the next field instead of the cursor just staying in the current field.
    Thanks in advance.
    rralilin

    Hi,
    there are more than one way to do this:
    1. use an ActionListener and transfer the focus in its actionPerformed(...) method - good for one or a few JTextFields - if there are more, try ...
    2. prelisten the key events via the new KeyboardFocusManager und replace the corresponding key event by a Tab-key-event and redispatch it - this approach enables you, to handle this new behavior for all JTextFields in one central position - possible since JDK 1.4
    Hope, this helps
    greetings Marsian

  • Field validation with Tab Key

    I am writing an application in which I must validate the data a user enters into a textfield when the user presses the "Tab" key. I have added a KeyListener to the textfield and when this java code is run as an applet the KeyListener catches the Tab key and all works fine. When I run this as an application, the Tab key does not seem to be caught at all by the Key Listener.
    Has anybody else had this problem on the IPAQ, if so, do you know a solution.
    Any help would be GREATLY appreciated.

    I've been having this problem as well. I have created my applet using Visual Cafe 3 (Java 1.1). When I run this in Jeode it work great, Personal java works great, MSVM works great, but when I try to run using Sun Plugin 1.4.2_02 the tab key events are never fired.
    Does anybody have a solution for this? Unfortunately, we are stuck developing with an older version of Java because of Visual Cafe.

  • Adf javascript clientlistener not capturing the TAB keypress event

    Hi,
    I have client listener attached to a text field to trap the keyPress event. The method is being called for all the key strokes except special keys like TAB, arrow keys, pageup, pagedown etc. Is there any possibility to capture TAB key event.
    <af:clientListener method="myFunctionTosetFocus"
    type="keyPress"/>
    function myFunctionTosetFocus(event) {
    alert('function called....')
    var keyCodePressed = event.getKeyCode();
    if(keyCodePressed == AdfKeyStroke.ENTER_KEY || keyCodePressed == AdfKeyStroke.TAB_KEY) {
    alert('Do some thing here....')
    I can see both the alert messages when I click on the ENTER key. But I cannot see both the alert messages when I cick on TAB key. The same is working without any problems in firefox.
    Thanks and Regards,
    S R Prasad

    Hi Frank,
    I tried with the event.cancel(). Now I can see the event.cancel() working for ENTER key, But not for the TAB key. I tried with the keyDown event in the clientListener and it is working with out any problems in both IE and firefox.
    It is not working as expected in case of keyUp event, If I set the focus to the next tab in the clientListener code, it is executing the clientListener of the destination component if the clientListener event is keyUp.
    Overall it is wotking as expected with the keyDown, But it is not working for the keyUp and keyPress events. All these are working as expected in firefox.
    Thanks and Regards,
    S R Prasad

  • Did a tab key initiate exit event?

    Hi,
    I have a table on my form. If the user hits the tab key on the last field of the last row I want to add another row (as this happens in MS-Word tables for example).
    My problem is: How do I find out what inititated an exit event on my field? Was it a tab key or did the user click with the mouse someplace else?
    I would like to write something like
         if (xfa.event.trigger = "TABKEY") { ... }
    Hope someone had had the same problem already.
    Uli

    Excellent. I tried it and it works! Thanks a lot!
    Once you know the key word you find the right documentation. In case someone else has the same problems: Here is more information:
    http://livedocs.adobe.com/livecycle/8.2/acrobat_designer/wwhelp/wwhimpl/common/html/wwhelp .htm?context=Adobe_LiveCycle_Designer_Help&file=001421.html
    which is the same as
    http://www.adobe.com/devnet/livecycle/articles/Adobe_XML_Form_Object_Model_Reference.pdf

  • Unable to receive Tab key press event

    Hello,
    I have written a component which extends JComponent.
    For that , when Tab key is pressed I need to process something.
    I have overridden the function processKeyBinding in my class.
    But I am not getting any event for tab key press. For all the other key press events, the function is being called.
    I also tried to create a action and add it to the action map. But that is also not working.
    Can anyone explain me why it is not working and give me the solution.
    Thanks in advance,
    Anu

    public static void removeTabFromFocusTraverval(Component c) {
         int id = KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS;
         Set strokes = c.getFocusTraversalKeys(id);
         Set newStrokes = new HashSet(strokes);
         newStrokes.remove(KeyStroke.getKeyStroke("TAB"));
         c.setFocusTraversalKeys(id, newStrokes);
    }

  • To trigger event or action on "TAB" key press on web dynpro view

    Hi, I need to trigger event on "TAB" key press on web dynpro view , is it possible?How?

    Hi Dipak
    What Madhu said is correct. Tab key is pre-configured to move cursor from 1 field to next field. we can not create an event on tab key press.
    Regards
    Gaurav

Maybe you are looking for

  • Sub contracting Purchase requisition not created thru Service Order

    Hi Experts, I configured to create Service order automatically from Customner service. Now we have the SM03 repair service order .When we try to create Sub contracting Purchase requisition. (Selecting Subcontr tick in External tab of Components tab)s

  • Missing package information

    I changed my bt package effective from today and the order information says completed.  It should be unlimited broadband and unlimited anytime phone calls.   However mybt says weekend/evening calls only(which I've never had).  I have read stephanieg'

  • Images not loading with ML

    Pretty much trouble free with the upgrade except for a couple of issues: 1.  Images on Safari are not loading on a lot of webpages ... getting the deadly blue box instead. 2.  MBA is extremely slow to start up or shut down.  Prior to ML my MBA starte

  • Job terminated in source system  SAPSQL_SQLS_INVALID_CURSOR

    Hi all, can any one help on this issue. I run the BI statistics and found out the error while triggering the delta's Job started Step 001 started (program SBIE0001, variant &0000000000756, user ID Asynchronous transmission of info IDoc 2 in task 0001

  • Shuffle Playlist songs only

    Hey I have an 80gb video, and i love it but im dissapointed with apple for having very little instructions on how to use it (i've figured most of it out now) but i just made a playlist after four months and im a little mad. for one reason and that is