• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X Scripting - Skill
  3. How to detect Ctrl key pressed during list selection?

Stats

  • Replies 3
  • Subscribers 17
  • Views 9523
  • Members are here 0
More Content

How to detect Ctrl key pressed during list selection?

EvanShultz
EvanShultz over 6 years ago

I have a SKILL form with a LIST-type FIELD in it. I would like the list to be multi-select and do something different if the user is holding down Ctrl when selecting an item vs not holding down any key. Is this possible? Nothing in the form callback for the list element indicates a modifier key is pressed (that I can see, anyway) and I'm not sure where else to look.

I write the subject of this discussion generic but the concept should apply to other modifier keys (for example Alt) and other form elements.

  • Cancel
  • Sign in to reply
  • EvanShultz
    EvanShultz over 6 years ago

    Maybe I should explain what I'm thinking. The list on the form currently only supports a single selection, but I was thinking of an enhancement that would require multiple selection.

    I currently print the form like this:

    fprintf(port "FIELD CompList\n")
    fprintf(port "FLOC 2 8\n")
    fprintf(port "LIST \"\" 42 10\n")
    fprintf(port "ENDFIELD\n")

    From reading the BNF docs I figured out I can add this line to this section of the form to make it multi-select:

    fprintf(port "OPTIONS multiselect\n")

    But I haven't figured out what that buys me. Multiple items in the form are then selected, but the form callback only reports the item I clicked on. That means I can't figure out if the user selected an item with Ctrl pressed, and so I need to add the clicked item to the select set, or if the user didn't press the Ctrl key and I need to clear the select set and then only add the clicked item.

    I don't find an Allegro dialog with this user paradigm (they all have separate "selected" and "unselected" lists, like the "Find by Name or Property" form) so maybe I should rethink how I was approaching this form?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 6 years ago in reply to EvanShultz

    axlFormListGetSelItems

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • EvanShultz
    EvanShultz over 6 years ago in reply to eDave

    Ah. That's it! Thank you.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information