• 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. Custom IC SKILL
  3. Conditional Bindkey Function

Stats

  • Replies 2
  • Subscribers 144
  • Views 1391
  • Members are here 0

Conditional Bindkey Function

EA1000
EA1000 4 months ago

Hi Everyone,

Please help me figure this out.

For example, I have an a() function that's bound to the <key>a in the layout.

then I also have another function b() that's bound to the <key>b in the layout.

Conditions:

  1. function b() will only be activated once the function a() is activated.
  2. function a() will be deactivated by pressing other bindkeys (example bindkeys q, x , f etc.)
  3. function b() will return to its default command function default() when Function a() is deactivated.
  4. the form xyz() that's bound to the <key> F3 will open once the function a() is activated. - similar to default functions that use f3 to open a form.

Thank you in advance for your help.

  • Sign in to reply
  • Cancel
  • henker
    henker 3 months ago


    You can read the current bindkey assignment with hiGetBindKey and set/change it with hiSetBindKey, this can also be done inside procedures, which should sufficiently cover your wish for conditionals,

    So in your example you could inside a() set the bindkey 'b' to execute b(), so this 'b'-key binding is only available after pressing 'a'-key; and remove the bindkey iwith another function that is called when 'q' is pressed, etc.pp.

    Or set a and b bindkey unconditionally and have a global variable (questionable style) that is set to 'a is activated' inside the a() function, and inside b()  is checked if the variable contains what is expected and continues, or bails out.

    But your wording is IMHO inconsistent, so I might have misunderstood, e.g. while I think that 'to activate a function' just means to call it, I've struggled with 'to deactivate a function'; I boldly assumed it means that further calling of the function is prevented; which here could be done e.g. by removing the bindkey assignment.


    Anyway, as note from a bystander; your scheme sounds awfully complicated:

    The user not only has to remember multiple bindkeys, he also has to remember the order (first 'a' then 'b', then 'q' to quit, etc.) and has also to follow the state changes, e.g. was a() called or not, was b() called or not, etc. This gets even more complicated with error handling, e.g. what if a() fails, does enabling the 'b'-key make even sense, or is the whole thing aborted; how is the user informed that a/b/c/... is 'activated' or 'deactivated'.

    However, as you already plan a form, it may be much easier to just open the form directly on a single bindkey or a menu, and the form could then contain e.g. buttons to execute a(), b(), etc. The conditionals could than enable the b-button only when the a-button is clicked and succeed, and so on. So the user can directly see the current state and the next possible steps. Just as rough idea.

    Also I guess you have a wrong understanding of the mechanism regarding 'the form xyz() that's bound to the <key> F3'.
    Forms are not bound to F3, forms (more specifically 'option forms') can be specified on enter functions, than the F3 will toggle the mapping of this option form when inside this enter function. I'd recommend to have a look into the documentation, keywords 'User Entry Functions', 'hiCreateOptionsForm', and 'hiToggleEnterForm'.

    Regards,

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 3 months ago in reply to henker

    I agree that it sounds awfully complicated.

    There is a new mechanism coming in IC25.1 called "dynamic bindkeys" which allow you to define a set of bindkeys that are only applicable whilst another command (generally an enter function) is active. This means that commands (e.g. Quick Align) can define special bindkeys that make sense when that command is active, and the same keys can be used during a "Move" to do something else (for example). It has more granularity than the simple normal/enterfunction bindkey mechanism we have right now.

    I'm not sure it's quite what's needed to implement your complex approach, but I think it offers a reasonable use model, so maybe that would allow you to achieve what you want (if you can wait another couple of months).

    Andrew

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

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