Capturing Enter key event from text box

In my application, there are a number of text boxes. I want to create a feature where an enter key even is seen and specific function executed depending on which text box was in focus when the enter key was pressed. Currently I am able to capture an enter key event on the whole page. How do I do that specifically for a text box?
This application is done in HTML, javascript and Adobe AIR.
Thanks
Binu
www.verseview.info

Hi
That's true that Flex4.5 SDK under Flash builder Burito doesn't listen Enter key in Text Area for KeyUp or KeyDown event.
Here I found a work around you can use.
Add an eventlistener to the component in actionscript and set the useCapture=true next to eventlistener function. Now you can listen enter key for KeyUp or KeyDown Event
Hope this helps
Rush-me

Similar Messages

  • Flex4.5 SDK under Flash builder Burito doesnt dispatch Enter key event in Text Area anymore

    Flex 4.5 under Flash builder Burito doesnt dispatch 'Enter' key event in Text Area anymore, in prev version 4.1 it was working properly, this stopped working after migration to Burito + Flex SDK 4.5?
    What that suppose to be?

    Hi
    That's true that Flex4.5 SDK under Flash builder Burito doesn't listen Enter key in Text Area for KeyUp or KeyDown event.
    Here I found a work around you can use.
    Add an eventlistener to the component in actionscript and set the useCapture=true next to eventlistener function. Now you can listen enter key for KeyUp or KeyDown Event
    Hope this helps
    Rush-me

  • Capture 'Enter' key event

    Hi,
    Is there any way we can capture the event when a user presses the enter key inside a text field?

    Hi andrewquay
    you can capture the enter key by adding the following code in the textfield's change event.
    if(xfa.event.change == "\u000a")
    xfa.host.messageBox("enter key is pressed");
    mail: [email protected]

  • Remove the Enter key binding from a JPopupMenu

    Hi,
    Does anyone know how to remove the Enter key binding from a JPopupMenu?
    So when the popupmenu is showing and you type Enter, nothing should happen and the menu should stay where it is.
    I have tried:
    popup.getActionMap().put("enter", null);
    popup.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "enter");but the popup always disappears.
    Any ideas?
    Cheers,
    patumaire

    First of all, that is not the proper way to "remove" a key binding. Read the Swing tutorial on [How to Use Key Bindings|http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html#howto] for more information.
    However, we still have a couple of problems:
    a) the input map is dynamically built as the popup menu is displayed
    b) the input map is built for the root pane, not the popup menu
    The following seems to work:
    popup.show(...);
    InputMap map = getRootPane().getInputMap(JTable.WHEN_IN_FOCUSED_WINDOW);
    map.put(KeyStroke.getKeyStroke("ENTER"), "none");
    KeyStroke[] keys = map.allKeys();
    for (int i = 0; i < keys.length; i++)
         KeyStroke key = keys;
         Object action = map.get( key );
         System.out.println(key + " : " + action);

  • Capturing Enter key in ALV

    Hi Experts,
    Am using an editable alv. I want to perform some actions when Enter key is pressed.
    I did this in DOMODIFY. But this makes the scroll bar in initial position. Kindly help me on this.
    Regards,
    Vijayakumar.

    Hi vijayakumar,
    You can refer this link for info about ENTER key event trigger. Could you please post what you want to perform when Enter key is pressed.
    Link: [http://wiki.sdn.sap.com/wiki/display/ABAP/InteractiveEditableOOALVgridwithdynamicitab,FCATandENTERkeyeventtrigger]
    Regards,
    Anand G

  • Handling 'enter key' event in alv using classes

    Hello all,
        i have a scenario where i have a grid from which i have to select a row and press 'enter' key, then the row would be added to grid on top of it. we have developed this grids using control and classes.
        please any one tell me how would i get the enter key code.
    Thanks,
    krishnam raju N

    HI Raju
    just go through these
    check the sample program.
    <b>BALV_POPUP_TO_SELECT
    ENTER is nothing but selecting the record.
    </b>
    Re: ALV  'ENTER' key
    and go through this code
    constants :
    C_PF_STATUS TYPE SLIS_FORMNAME VALUE 'F_SET_PF_STATUS'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = V_REPID
    I_CALLBACK_PF_STATUS_SET = C_PF_STATUS
    I_CALLBACK_USER_COMMAND = P_USER_COMMAND IS_LAYOUT = WA_LAYOUT
    IT_FIELDCAT = IT_FIELDCAT[]
    IT_EXCLUDING = IT_EXTAB[]
    IT_SORT = IT_SORT[]
    TABLES
    T_OUTTAB = P_ZBCAR50
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    2.
    *& Form F_SET_PF_STATUS
    Set PF_STATUS STANDARD modifying the standard toolbar
    by excluding some buttons
    -->P_IT_EXTAB -- TABLE OF EXCLUDING FUNCTIONS
    FORM F_SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
    CLEAR : WA_EXTAB,
    IT_EXTAB.
    *--Set the Modified PF status for the ALV.
    SET PF-STATUS 'STATUS_01' EXCLUDING RT_EXTAB.
    ENDFORM. " SET_PF_STATUS
    3.
    *& Form f_user_command
    Handle user action on ALV toolbar
    FORM F_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
    DATA : L_ANSWER TYPE C.
    RS_SELFIELD-REFRESH = C_X.
    IF R_UCOMM = 'ENTR'.
    Do your processing here.
    ENDIF
    and go through these links
    <b>how to identify pressing ENTER on ALV
    How to capture the event in ALV grid display?
    Re: ALV-Grid: No reaction to Enter-Button
    </b>
    IF IT HELPS REWARD WITH POINTS
    Regards Rk
    Message was edited by:
            Rk Pasupuleti

  • KeyListener does not capture Arrow key Events in textField

    Love................
    I added a key listener to TextField it does not detect
    Arrow Keys events in keyTyped, KeyPressed,KeyReleased methods
    why?????
    I want to shift focus from a textfield to other component
    on capturing Arrow key Pressed How

    Here is a Java demo where it works since it is not a printable character you must get the keyCode:
    http://java.sun.com/docs/books/tutorial/uiswing/events/example-swing/index.html#KeyEventDemo
    public class KeyEventDemo ... implements KeyListener ... {
    ...//where initialization occurs:
         typingArea = new JTextField(20);
         typingArea.addKeyListener(this);
    /** Handle the key typed event from the text field. */
    public void keyTyped(KeyEvent e) {
         displayInfo(e, "KEY TYPED: ");
    /** Handle the key pressed event from the text field. */
    public void keyPressed(KeyEvent e) {
         displayInfo(e, "KEY PRESSED: ");
    /** Handle the key released event from the text field. */
    public void keyReleased(KeyEvent e) {
         displayInfo(e, "KEY RELEASED: ");
    protected void displayInfo(KeyEvent e, String s){
         char c = e.getKeyChar();
         int keyCode = e.getKeyCode();
         int modifiers = e.getModifiers();
         tmpString = KeyEvent.getKeyModifiersText(modifiers);
         ...//display information about the KeyEvent...
    }

  • Paste does not work in Safari browser to enter copied content into text box

    For example when I go to copy a URL Sosa to paste it into a text box on a local newspaper comment section, it won't paste in. Same goes for any pasting into the text box. I highlight what I want to copy (or cut) and the go to paste it into the text box, and nothing happens. Also there is this problem of the cursor not wanting to go where you direct it with your finger on the touch screen, where you have to get out of the data entry mode altogether then get back in to be able to continue typing to enter text, an d to add to the frustration, the cursor won't go where you want it to, but seems to arbitrarily choose an other place in the middle of the word next to where you want it to! Anyone experience this? I can't believe I'm the only one.

    Please don't take offense, you can't believe what some people post and then realize later that they have had a "duh" moment.
    I don't know what to suggest other the basic fixes, rebooting (holding the sleep and home buttons down until the Apple logo appears) and see if that helps - maybe clear the cookies and data in Safari even though that should not have any bearing at all on this issue or so I would think.
    I can relate to the cursor jumping on the screen issue as I do experience that from time to time. Not quite as bad as you seem to experience it, but it does happen to me as well. I have found that I get the best results using a light touch. And of course I will also enlarge the screen as well if I get too frustrated with the insertion point.
    Can we assume that you can copy and paste with the success in email, notes, etc?

  • Enter Key Event in Editable ALV Grid

    Hi all,
    I am trying to create and editable ALV grid using the REUSE ALV FM.
    On the grid after changing a value, if I press enter key the pai is not triggered. I have tried the various example programs (BCALV*) but could not find anything relevant.
    Basically I need similar functionality to normal module pool programming as in validations on screen done when enter key is pressed after screen entry.
    Is it possible to capture the Enter keypress on the ALV grid?

    Hello Preet
    I can only tell you how I would solve this using the ALV grid control (CL_GUI_ALV_GRID) because I have abandoned using ALV function modules.
    The problem with running through PAI is whether the focus (i.e. the cursor) is still on the control or already on the (surrounding) main program. If the control has the focus, you do not run through PAI.
    I would add a "Refresh" button to the toolbar of the ALV list. Normally, this button is already there or you only have to make it visible.
    When the user pushes this button you catch the corresponding user-command and call the CHECK_DATA_CHANGED method to see if values have been changed on the editable grid. If so, the previous method will fire event DATA_CHANGED.
    Now, in the event handler method (e.g. HANDLE_DATA_CHANGED) you receive as input a data change object (CL_ALV_CHANGED_DATA_PROTOCOL). This object contains all changed values. These values you will need to make your checks.
    I assume that the logic will be similar using ALV function modules.
    Regards
       Uwe

  • How to handle Text  change event in text box in SAP B1

    Hello Expert...
    How to handle Text  change event in source.
    Please define the Event when i change the text in textbox..
    currently i am using the Lost focus event but it is only occur when tab focus lost from that text box.
    So please required solution ASAP..
    Regards,
    Abhinav Lalpurwala
    Edited by: Abhinav Lalpurwala on Aug 5, 2011 3:19 PM

    Hi,
    Catch the et_VALIDATE event, when InnerEvent = False and ItemChanged = True.
                If pVal.EventType = BoEventTypes.et_VALIDATE Then
                    If pVal.InnerEvent = False And pVal.ItemChanged Then
                        'TODO Your code here...
                    End If
                End If
    Regards,
    Vítor Vieira

  • Capturing Enter Key Press

    Hi
      Is there a way where we can capture the Enter Key press of the Keyboard and call an event on the Enter Key Press??
    For fields such as input field there is onEnter field where an event can be called, but we have a requirement where in we need to call an event on click of enter key, irrespective of where the focus on the page is on.
    Any inpus on this will be helpful.
    Thanks & Regards,
    Gayathri Shanbhag

    Hi Gayathri,
    See if the following link helps:
    https://cw.sdn.sap.com/cw/docs/DOC-107045
    Regards,
    Himanshu

  • Capture desktop key event to control my screen capture app

    I want to write a screen capture program to capture screen when I am playing fullscreen game or other desktop window application. But the java screen capture program can only receive key or mouse event when it is focused. So how do I capture key event when I am focusing other app or fullscreen app?
    Do I have to use JNI and call some OS specific API. My target OS is WinXP. Help or suggestions are appreciated!!

    Hi All,
    I was wondering if there is a way to capture the top-most
    window or dialog box. This is something that will
    generally be running outside of the JVM....We,
    as programmers, need a Rectangle instance that describes the area
    of interest to be captured (i.e., location and size).
    Thus, a routine that interfaces to the Native windowing system (Toolkit?)
    might look something like:
    Rectangle rect = tk.getRectangleForTopMostComponent();
    Does anything like this exist?
    Thanks!
    - DocJava

  • Capture enter key press in h:inputtext

    hi,
    i have a h:inputText component in my jsf page. i need to capture the enter key pressed for this component. how can this be done.
    thanks in advance.

    You can use Javascript for this. In the onkeypress event, check if the keycode is 13 (the enter key) and handle accordingly.
    onkeypress="if (event.keyCode == 13) alert('Enter pressed!');"

  • Capturing ENTER key in WD4A

    Hi all,
    I m getting an input from the user in an Inputfield. I also have a table with two columns.
    The textfield is used to perform wildcard search (filter) for the table. That is, if i give a character like 'A', then the records which start with the character 'A' must be shown in the table when i press teh ENTER key..
    I have got this outptu when i click a button. But i want to get the same output, when i give 'A' and press ENTER key..
    How to acheive the same in WD4A?
    Regards,
    Shanthi

    hi Shanthi,
    for the corresponding Enter key , make a action say act in the EventPropery of the element.
    in the Onactionact,method in the Methods tab , write the same piece of code , which u r writting in the Button
    u wud be able to do it nw
    regards,
    amit

  • Handling Enter key event in JTable

    Hi...
    This is particularly for the user "VIRAVAN"...
    I have followed your method ,and got results too.. but the
    processKeyBinding(.. method is called 4 times,same problem addressed by you before, but I didn't understood it...
    Please help me...
    Here is my code...
    protected boolean processKeyBinding(KeyStroke ks, KeyEvent e,int condition, boolean pressed)
    System.out.println("Wait");
    if (ks == KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0))
    int selRow = getSelectedRow();
    int rowCount = getRowCount();
    int selCol = getSelectedColumn();
    String val =(String)getValueAt(selRow,selCol);
    boolean b= getCellEditor(selRow,selCol).stopCellEditing();
    System.out.println(b);
    System.out.println(rowCount-1 + " "+ selRow + " " + getSelectedColumn());
    if((!val.equals("")) && selRow==rowCount-1)
    System.out.println(rowCount-1 + " "+ getSelectedRow()+ " " + getSelectedColumn());
    blank1 = new String[columns];
    for(int p=0;p<columns;p++)
    blank1[p]="";
    Diary.this.datarows.addElement(blank1);
    // dataModel.fireTableStructureChanged();
    //dataModel.fireTableDataChanged();
    Diary.this.dataModel.fireTableChanged(null);
    else if(ks ==KeyStroke.getKeyStroke(KeyEvent.VK_1,0))
    System.out.println("One One One One ");
    return super.processKeyBinding(ks,e,condition,pressed);

    It's been a while since I looked at the code, but essentially there are three key event types:
    1) key pressed,
    2) key typed,
    3) key released.
    So I would expect the processKeyBind to see all three of them. However, ks==KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0) is true only when a key typed event is detected (the other types can be ignored by passing it up the food chain where they will eventually be consumed). Now...., if I understand you correctly, you want to terminate edit on the present of Enter key, right? Here is how I'd suggest you do:
       protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {
          if (isEditing()) {
             Component editorComponent=getEditorComponent();
             editorComponent.stopCellEditing();
             return true;
          return super.processKeyBinding(ks,e,condition,pressed);
       }Ok.... now, it appears that you want to do something else also... i.e., add a new row to the table if the editing row is the last row and the editing column is the last column of the last row. You can't do that in the same thread (i.e., you must wait until the update in the current thread is completed). So, what you must do is use the SwingUtilities.InvokeLater, like this:
       protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {
          if (isEditing()) {
             Component editorComponent=getEditorComponent();
             editorComponent.stopCellEditing();
             if (getEditingRow()+1==getRowCount() && getEditingColumn()+1==getColumnCount()) {
                SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
    // put the code for adding new row here
             return true;
          return super.processKeyBinding(ks,e,condition,pressed);
       }OK?
    ;o)
    V.V.
    PS: posted code is untest but should work!

Maybe you are looking for

  • Insert UK Date Into MS SQL Database

    Hi All.. I'm using Dreamweaver 8.02, Classic ASP and MS SQL 2008 I'm having problems inserting a UK formatted date from my form to my database. My form uses a standard text box for entering a date in the format of dd/mm/yyyy and inserts the a field i

  • Search in external files with Oracke DB?

    Is it possible to use Oracle DB to search in external files (Excel and Word)? If yes, does it work in version 7 and 8 also? Per Magne

  • ICloud drive or one drive

    I use ms office on both my iMac's, my ipad2, and, my 4s.  I have the office apps on my iapd2 and iPhone (excel, pp, and word).   So far, the ms onedrive has worked great, especially since i can not only access all my files seamlessly from any one of

  • PLEASE HELP!! ORACLE/ORANT/FORMS

    HELLO I AM FROM ATHENS GREECE I HAVE NO IDEA FROM ORACLE AND FORMS BUT I MUST SAVE AND OPEN FILES FROM A CRASHET PC FROM A CUSTOMER. WITH NTFS FILES BACKUP I HAVE SAVE THIS FILES ON C: oracle: admin ora92db oradata orant and ROTA: AKINITA.fmx FISPROS

  • Simultaneous auto packing of multiple deliveries using trans. VL02N

    Standard SAP does not allow simultaneous auto packing of multiple deliveries contained in one shipment in transaction VL02N. so i need to create custom transaction to allow the user to auto pack one or more deliveries simultaneously.I tried using rec