Make Tab Key Press Event

Hi You all,
I'm trying to make an automatic Tab Key Press after fill some data to oEditText  , plz guide me how can i do that ?
I will appreciate your help.
Peter.
Edited by: PeterHoang on Oct 12, 2011 12:22 PM

Hi
You can use sendkeys method for this
SBO_APPLN.SendKeys("{TAB}")
Regards
Arun

Similar Messages

  • 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

  • Question about generate key press event to system. help plz.

    I am wondering if it is possible to write a java program to generate key press event(not receiving)to the local system so all the other program in the system receive those key press event also. Thanks.

    Hi,
    :. I don't know what exactly you intend to accomplish. But, I have used the following code in order to simulate keys pressing inside a Java application.
          /* - - - Simulates TAB (java.awt.Event)
          EventQueue evtq = Toolkit.getDefaultToolkit().getSystemEventQueue();
          evtq.postEvent( new KeyEvent(this, KeyEvent.KEY_PRESSED,
                          0, 0, KeyEvent.VK_TAB, KeyEvent.CHAR_UNDEFINED) );
          evtq.postEvent( new KeyEvent(this, KeyEvent.KEY_RELEASED,
                          0, 0, KeyEvent.VK_TAB, KeyEvent.CHAR_UNDEFINED) );
          /* - - - Simulates Shift+TAB (java.awt.Event)
          evtq.postEvent( new KeyEvent(this, KeyEvent.KEY_PRESSED, 0,
                          InputEvent.SHIFT_DOWN_MASK, KeyEvent.VK_TAB,
                          KeyEvent.CHAR_UNDEFINED) );
          evtq.postEvent( new KeyEvent(this, KeyEvent.KEY_RELEASED, 0,
                          InputEvent.SHIFT_DOWN_MASK, KeyEvent.VK_TAB,
                          KeyEvent.CHAR_UNDEFINED) );:. However, as far as I know to send keys to the whole OS you have to create a 'Hook' as described inside Win32API documentation. That's for Microsoft Windows naturaly.
    Cheers.
    Roque

  • Disable Alt+F4, Alt+Tab key press

    Hi Guys, my WPF launched with maximized mode & i must restrict the users for the items:
    'Alt + F4': Not to use 'Alt + F4' to close the application
    'Alt + Tab': Not to switch to another application in the system, so i want to disable 'Alt + tab' key-press.
    Note: I couldn't find any solution specifically for 'Alt + tab' key-press.
    Thank you

    Disabling ALT + F4 can be done by adding an event handler for the window's KeyDown event:
    public Window1()
    InitializeComponent();
    this.KeyDown += Window1_KeyDown;
    void Window1_KeyDown(object sender, KeyEventArgs e)
    if (e.Key == Key.System && e.SystemKey == Key.F4)
    e.Handled = true;
    >>I couldn't find any solution specifically for 'Alt + tab' key-press.
    The ALT + Tab keyboard stroke is handled at system level so you will need to hook into the Windows API to get access to the keyboard and intercept these calls somehow. Please refer to my example of how to use a low-level keyboard hook in WPF in the following
    thread for more information:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/cbb5d6ea-432d-42b5-a6e1-814cda9db030/registerhotkey-for-capslock-doesnt-work-in-laptops-keyboard?forum=wpf. There is probably no easy (or easier) way of doing this.
    Here is an article that may also be helpful for you:
    http://www.codeproject.com/Articles/14485/Low-level-Windows-API-hooks-from-C-to-stop-unwante
    Hope that helps.
    Please remember to mark helpful posts as answer to close your threads and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

  • Why i am unable to catch the 'TAB' key press?

    hi
    i have an application where i have 2 text fields and one button in order say t1, t2 and b1.
    on tabbing t1 cursor moves to t2 and on tabbing t2 cursor moves to b1 and on tabbing b1 cursor moves to t1.
    now when i press tab button on any of the component i have written a keyListener for that to catch 'TAB' key using the comparision
    if( e.getKeyCode() == KeyEvent.VK_TAB )
    but its not catching the tab key pressed on any of these 3 components....
    why like this...
    i want to catch the press of 'TAB' key and write some action for it... but unable to catch the 'TAB' key press.
    anyone could help me in this....
    thanx in advance,
    -Soni

    I seem to remember this question being asked before. I think the answer was that the FocusManager intercepts the TAB key. I don't remember the solution but you can try searching the forum.

  • How to binding a key press event of "Esc" to "cancle" button

    I create a class extended JComponent. Than I add a button named "cancle " to it.
    Than I add the class's instance to a JDialog object.
    I try to get the key press event through add a keyListener to the class instance, but no works.
    I try to add a keymap and action map to the dialog 's getRootPane() also no works.
    Who can tell me how can I do?

    Thats the way I did it:
        // map escape key
        ActionListener escapeActionListener = new ActionListener()
          public void actionPerformed(ActionEvent e)
            cancelPressed();
        this.registerKeyboardAction( escapeActionListener,
                                     KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false),
                                     JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );

  • Raise Key pressed event

    Hello, any know how can I raise a key press event throw code. For example I want to simulate that the user has press the A Key. How can I do that throw code?
    Thanks a lot !!

    Hi there,
    Your question has been discussed previously in the forums. Sounds like you want to programmatically click a button in WPF.
    Please check out this post
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1329603&SiteID=1
    Thanks,
    Jennifer

  • How to detect space key pressed event

    I am working on a japplet where it is needed to pause the applet on the occurrence of a space bar key pressed event can anybody help
    thanks in advance

    Have a look at the tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/events/keylistener.html
    http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html
    -Puce

  • How to handle form close event or escape key press event for user defined f

    Experts,
    Please let me know how to handle form close event or escape key press event for user defined form...
    Thanks & Regards,
    Pravin.

    Hi
    You can catch the form close event like this
    If ((pVal.FormType = 139 And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_CLOSE)) And (pVal.Before_Action = True)) Then
          Try
                   SBO_Application.SetStatusBarMessage(pVal.EventType.ToString())
          Catch ex As Exception
                    SBO_Application.SetStatusBarMessage(ex.Message)
            End Try
          End If
    Hope this helps
    Regards
    Arun

  • Anulate tab key press

    Hi all!
    I have a little problem.
    How can I anulate a tab key press in a TextArea?
    I have this TextArea in an Applet and it's ocurrs only with Microsoft VM. I try with consume() method of KeyEvent but no work.
    Thanks a lot.
    Sergio Mart�n

    Hi arjunravinarayan!
    Thanks for anwer!
    The question is that I want no change in the TextArea content.
    When a press the tab key, a tab space is added to TextArea.
    Sergio Martin

  • Can we fire key press event programmatically????

    hi there,
    is it possible in java to fire a key press event (of the associated component) programmatically??? like we can fire action event of a button by saying
    button.doClick();
    thanks in advance.
    anshu

    You can do so by using awt.Robot.keyPress(), just don't forget to do awt.Robot.keyRelease() afterwards!
    Note that it doesn't work for Applets unless you sign them, for security reasons (you don't want to go into a site and have the applet click ctrl+alt+del for you, right?)
    Cheers!
    Moti

  • Intercept tab key press

    Hi,
    For my application I need to use a textarea as a code editor
    but my problem is that tabulation key is used to give the focus to
    the next control but I want the tab key to simply insert a
    tabulation.
    Here is my current state:
    I have this in my textarea definition:
    keyDown="onKeyDown(event)"
    and in a script block:
    private function onKeyDown(event:KeyboardEvent):void
    if( event.keyCode == Keyboard.TAB ){
    ta.text+= "\t";
    When I hit the tab key a tabulation is added as planned but
    the focus go to the next control, I tried "event.preventDefault()"
    and "event.stopPropagation()" but both failed, the focus still
    manage to leaves the control. I also tried to change all my
    controls focusEnabled properties to false but now the problem is
    that the event is not event fired when pressing tab, it is fired
    however when I press alt+tab...
    I hope someone has a magical solution since I have no ideas
    left :/

    Hi arjunravinarayan!
    Thanks for anwer!
    The question is that I want no change in the TextArea content.
    When a press the tab key, a tab space is added to TextArea.
    Sergio Martin

  • Key pressed event

    I need message to be displayed when certain key pressed. Why it's not working?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class TestKey extends JPanel implements KeyListener {
         public TestKey(){
              addKeyListener(this);
         public static void main(String arg[]){
               JFrame frame = new JFrame();
                  frame.setTitle("Test my keybord, man!");
                  frame.setSize(300, 200);
                  frame.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                      System.exit(0);
                  Container contentPane = frame.getContentPane();
                  contentPane.add(new TestKey());
                  frame.setVisible(true);
         public void keyPressed(KeyEvent ke){
              System.out.println("key pressed");
         public void keyTyped(KeyEvent ke){
              System.out.println("key typed");
         public void keyReleased(KeyEvent ke){
              System.out.println("key released");
    }

      public TestKey(){
        setFocusable(true);//<----------
        addKeyListener(this);
      }

  • How to change a h:outputText value in the current form on key pressed event

    Hello Suners,
    Greetings! I'm developing my first JSF web application and i'm trying to figure a way out to change outputText value when key pressed on another inputText so that when the user is typing his name for example he can see the letters showing respectively in the outputText.
    I managed to do it onchange but the user must focus out of the inputText to see his name in the outputText which is not right and the form must submit onchange event which is annoying.
    <h:inputText value="#{login.username}" title="name" id="name" required="true" onchange="this.form.submit()" >
                                <f:validateLength maximum="10" minimum="1"/>
                                <f:validator validatorId="myValidator"/>
                                <f:valueChangeListener type="classes.MyListener"/>
    </h:inputText>Is there any listener i can associate with the "onkeypress" attribute? Can anyone help me to do that with JSF?
    King Regards,

    hi, with JSF 2 you got the ajax tag, just tried it and it works fine :)
    <h:inputText id="myinput" value="#{back.name}">
        <f:ajax execute="@this" event="keyup" render="outtext"/>
    </h:inputText>
    <h:outputText id="outtext" value="#{back.name}"/>or before JSF 2
    <h:outputScript name="jsf.js" library="javax.faces" target="head"/>
    <h:inputText id="myinput" value="#{back.name}" onkeyup="jsf.ajax.request(this, event, {render: 'outtext'}); return false;"/>
    <h:outputText id="outtext" value="#{back.name}"/>The name property is a simple String in the bean.
    Hope this helps
    Edited by: hereps on Aug 21, 2010 7:18 AM

Maybe you are looking for