[JS SUI] How set enter key in listbox?

var w = new Window ("dialog");
var myList = w.add ("listbox", undefined, ["one", "two", "three"]);


myList.addEventListener ("keydown", function (kd) {pressed (kd)});


function pressed (k)
{
    if(k.keyName == "Enter")
    {
        var idx = myList.selection.index;
        alert(idx);
    }

}
w.show ();

Hello.

Only the event key entered does not work in this script.

I want to enter the key events and get the index of the ListBox.

Any ideas?

Thank you.

A couple more observations:

1. the original script works if you press SHIFT + ENTER or Ctrl + Enter. (Edit: Peter beat me to it!)

2. change the "keydown" to the "keyup" event makes it work (although not repeatedly on the same list point unless the selection is modified in between, which is a little strange).

Ariel

Tags: InDesign

Similar Questions

  • How managed 'Enter' key

    Hi all

    I have a custom search region
    There are many search criteria fields
    When I select some fields and then press this button shows on click
    result based on a field that is selected in the result table.



    Now I want to show results after user, press 'Enter' on the keyboard

    How can I achieve this?

    Newbie says:
    Thanks AJ
    Instead of writing code for all fields
    can I directly manipulate button GO on enter
    is this possible?
    How?

    No, this is not possible. It's just the approach that I mentioned.

    Thank you
    AJ

  • When I press the SHIFT key to get to register this happened @: M and when I press on enter key this happens #__nb so how can I change the setting I tried to format it but it's always the Sammy _ same__Regards

    When I press the SHIFT key to get to register this happened @: M and when I press on enter key this comes up #.
    NB so how can I change the setting, I tried formatting but it's always the same
    Cordially Sammy

    Try another keyboard, if that solves your problem is faulty and should be replaced.

    "sammy06forever" wrote in the new message: * e-mail address is removed from the privacy... *

    When I press the SHIFT key to get to register this happened @: M and when I press on enter key this comes up #.
    NB so how can I change the setting, I tried formatting but it's always the same
    Cordially Sammy

  • How di - activate < CR > HTML Code "Enter Key"?  How to increase the police of DW help explanations

    Hello

    1. how di - activate < CR > HTML Code "Enter Key"?

    2. how to increase the police of DW help explanations?

    1. how di - activate"Enter key" HTML Code?

    Enter = paragraph

    Shift + enter = line break

    Line spacing between paragraphs and headings, use CSS to set the default browser.

    {p}

    text-indent: 4;

    margin-top: 0;

    margin-bottom: 0;

    line-height: 1.2em;

    }

    Does that help?

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics |  Print | Media specialists
    www.Alt-Web.com/
    www.Twitter.com/ALTWEB
    -------------------------
    HTML Validator - http://validator.w3.org
    CSS Validator - http://jigsaw.w3.org/css-validator/
    Tutorials - http://w3schools.com/

  • I can't use the "Enter" key to take me to a Web site, I typed in the navigation bar - I have to use the mouse to click on the arrow 'go. ' Why? How can I fix it?

    I can't use the "Enter" key to take me to a Web site, I typed in the navigation bar - I have to use the mouse to click on the arrow 'go. ' Why? How can I fix it?

    An extension, probably "AVG Safe"

  • How to enter the IdeaCentre Q700 BIOS setting screen?

    How to enter the IdeaCentre Q700 BIOS setting screen?

    Tried F1 and there is no setting in the BIOS.

    Thanks for any help!

    Hi and welcome to the forum!

    Lenovo's Manuel said:-

  • mx459 won't let me enter the WEP key number, allows only symbols and letters. How to enter numbers?

    mx459 won't let me enter the WEP key number, allows only symbols or letters. How to enter numbers?

    John

    This might help

    Press the SETUP button on the control panel of your printer.
    Using the arrows, select DEVICE SETTINGS, press OK.
    Select local network SETTINGS, then press OK.
    Select Configuration LAN wireless, and then press OK.
    If a message appears, press the WPS button, press STOP to cancel.
    Select STANDARD INSTALLATION in the next screen that appears, and then press OK.
    Select your access point or router, and then press OK.
    Press OK to confirm the access point name.
    Enter your password using the numeric keypad on the right.
    On the screen where you enter your password at the top right of the LCD screen, you should see a: 1. This indicates you are in digital input mode. If you press the asterisk (*) will be fixed: has or uppercase mode, pressing asterisk with tiny switch. To enter a letter in letter mode, you press the digital key to scroll through the available letters. For example: to enter a letter 'c', you press the '2' three times.
    Press OK when finished.
    The LCD will say "Connected", if the password is correct.

  • How to set the key numb to activate at startup

    How to set the key numb to activate at startup on computer laptop gateway running windows 7?

    Original title: numb locking button

    Hello Wan,

    Thanks for the quick response. We appreciate your time and your efforts.

    By default the NUM LOCK status is the same as it was before you shut down the computer properly. If it is on when you shut it down it will be on when you turn on the computer again.

    A few users have solved this problem by disabling fast boot option in the BIOS (Basic Input Output System). I would ask disable youFast Boot to the BIOS and check if that helps.

    For more information about how to disable Fast Boot in the BIOS, I would ask you to contact the manufacturer of the system.

    Note:

    BIOS change / semiconductor (CMOS) to complementary metal oxide settings can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the configuration of the BIOS/CMOS settings can be solved. Changes to settings are at your own risk.

    Hope the helps of information provided. Let us know the results and do not hesitate to post on the Microsoft Community, in case you have problems when you are working on Windows.

  • How do you get back to default enter key

    My Puppy went through my laptop keyboard and now whenever I press the ENTER key, the Power Options > change Plan settings box Monte. How can I get this default return?

    Looks like this - http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/why-is-the-enter-button-on-my-keyboard-opening-up/1623aae4-88d6-4851-870a-b4e73417878a (see "babycarrots" response and related responses).

    Maybe something to do with "Mobility Center"?

  • Set the button play to be the same as the Enter key

    Greetings,

    I am using Media Encoder CC 2015 and Encore CS6 Blu - Ray DVD authoring.

    I have a Macbook Pro running 10.11.5 2012 (El Capitan) is

    I find that on the remote, when I press the play button, it does not play the link I have on my Menu Blu - Ray.

    I have to press the Enter key so he could play.

    Is there a way in which I can put the button play to function as the Enter key?

    Thanks in advance for your answer.

    Kind regards

    Tiya

    I think that the answer is not simple. The only control you have is if a particular function is allowed, not how the BD Player interprets the button.

  • When I connect to the adobe page with my adobe id, I see onl "free membership". Its my right adobe id. I'm invited into a "working group" how to enter the license key I bought?

    When I connect to the adobe page with my adobe id, I see onl "free membership". Its my right adobe id. I'm invited into a "working group" how to enter the license key I bought?

    You accepted the invitation? If not please accept and share the results. Please try different browsers in case you are unable to accept it.

  • How to detect the moment you press the Enter key

    I use a texteditbox on a Panel to take input from the user. I want to process the contents of the edit box when you press the Enter key in the editing area. I wonder as to how I would be able to detect the key pressed? Pointers would be appreciated. Thanks in advance.

    Hello

    Yes, if you want to do something only if the Enter key is pressed, you must implement an IEventHandler and check the virtual keys kReturnKey and kEnterKey.

    Markus

  • How to use the ENTER key

    Hi all

    I got a login screen which consists of a two text fields and a buitton. If I use the keyboard to navigate, I use the tab key to navigate between each component, but to present the "connect" button I need to navigate to the button and press the SPACEBAR.
    Is anyway to change the default value after pressing a SPACEBAR to press the ENTER key.

    Thank you

    concerning
    Aerts

    "amthekkel" wrote in message
    News:gkffkr$BG5$1@forums. Macromedia.com...
    > HI all,
    >
    > I got a login screen which consists of a two text fields and a buitton. If
    > I
    > use the keyboard to navigate, I can use the tab key to navigate between the different
    > component, but we need to send the button "login" I need to go to the
    > button
    > then press the SPACE bar.
    > Is anyway to change the default value after pressing a SPACEBAR for pressing
    > the
    > ENTER key.

    Set the defaultButton of the container.

    HTH;

    Amy

  • How can I find setting up key for player blue ray Toshiba as an Extender

    Just bought a blue ray Toshiba BDX5300KB player. When I try to add extender for windows media Center, it asks the figure 8 set up key shown on the TV screen - my TV screen shows nothing! Where can I find this key?

    depends on your TV, if it supports play at, you have a few options. But
    without an Xbox 360, which is the only Extender, you will not be able to stream
    live. some recorded tv CAN run using play.
     
     
    Barb
     
    MVP - Windows/entertainment and connected home
     
     
    Please mark as answer if that answers your question
     
     
     
     
  • How to do the "Key-enter" trigger (when you click on enter key) works as the key "F8"?

    Hello. I have another question to ask.

    Oracle Forms 6i.

    I have a form in which SMARTBAR & by DEFAULT is the menu and there is no push buttons.

    In the form, there is a "field" named as "ID no.". After entering "No ID" in the field and click on the button 'Run query' in the menu 'DEFAULT & SMARTBAR', all the details of this respective "No ID" gets displayed in other areas. Even if I press "F8" all fields is displayed with values.

    But I have a requirement, i.e. after the entry "No ID" and click on the 'Enter' key, I want all the values to display.

    So I created a "Key-enter" trigger with the following code:

    BEGIN

    EXECUTE_QUERY;

    END;

    But after entering "No ID" and click on the 'Enter' key, the values are not displayed.

    What can I do to make this happen?

    Thank you.

    It depends on the design of your form. If your article ID is part of the base table block, you can do it.

    On your entry ID, create a KEY-NEXT-ITEM trigger:

    If: system.mode = "ENTER-QUERY" then

    execute_query;

    on the other

    next_item;

    end if;

    Now

    -L' user clicks enter the query (via smart bar icon or F7).

    -User enters ID and click on the button to execute the query.

Maybe you are looking for