• 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. Custom "window"-ed form, assign "Enter" for specific callback...

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 144
  • Views 2379
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Custom "window"-ed form, assign "Enter" for specific callback.

FlxZer
FlxZer over 7 years ago

Hi everyone.

I've stumbled across an issue that I couldn't solve myself by reading though skuiref.pdf or any other related document or discussion. I've created a custom tool with a GUI. Using hiCreateAppForm I was able to specify a callback to be executed when "Enter" button is pressed. I achieved this by setting ?callback and ?buttonLayout in the corresponding way:

hiCreateAppForm(
...
?buttonLayout 'ApplyCancel
?callback "myCB()"
...
)

 With it, user was able to swiftly type a term in a search field and press "Enter" to initiate the query ( myCB() ). So far, so good. However, I recently decided to put the my form into a window, thus it can be effectively min/maximized by user and allows me to add new menus in the banner field. Everything works smoothly, but since the form is now "Window"-ed ,  ?buttonLayout 'ApplyCancel and ?callback "myCB()" are no longer effective since the GUI does not have native Apply/Cancel buttons anymore.
 My question: is there a way to specify a default callback to be executed when Enter button is pressed, for a Window-ed form? As an example of what I'm trying to achieve is "Go" button in SKILL API Finder.
 hiCreateWindow does not have any parameter that resembles  buttonLayout & callback functionality and I couldn't identify a key binding function that would accept win_Id as input.  

Any help would be much appreciated!

Regards,
Boris

  • Cancel
Parents
  • FlxZer
    FlxZer over 7 years ago

    Hi all,

     I've actually got my self halfway there. I was able to assign key to my custom callback form using this:

      hiRegisterBindKeyPrefix(  "MyTool" "form"  )    
      hiSetBindKey(  "MyTool" "<KEY>Enter" "MyCB()" )  

    Which was what I initially intended to achieve. However, the BindKey triggers the CB initially, once I've put anything into the search field, but then it stops working. I have to manually change focus in the form in order to get the KeyBind work again.    
     How can I make the KeyBind mashable/spammable without the need to manually click elsewhere on the form to make it work again?  

    Regards,
    Boris

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • FlxZer
    FlxZer over 7 years ago

    Hi all,

     I've actually got my self halfway there. I was able to assign key to my custom callback form using this:

      hiRegisterBindKeyPrefix(  "MyTool" "form"  )    
      hiSetBindKey(  "MyTool" "<KEY>Enter" "MyCB()" )  

    Which was what I initially intended to achieve. However, the BindKey triggers the CB initially, once I've put anything into the search field, but then it stops working. I have to manually change focus in the form in order to get the KeyBind work again.    
     How can I make the KeyBind mashable/spammable without the need to manually click elsewhere on the form to make it work again?  

    Regards,
    Boris

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to FlxZer

    I had more success if I used "<Key>Return" rather than "<Key>Enter". With my keyboard it seemed to work fine if I did that.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FlxZer
    FlxZer over 7 years ago in reply to Andrew Beckett

    Hi Andrew,  

     "<Key>Enter" definition works only if numpad Enter key is used. It does not work with main Enter key for me either. Sadly, I'm not able to mimic the event when main "Enter" key is pressed in SKILL API Finder window. Judging by its behavior the CB ( startSearch ) is associated with "Find what" ComboField and "Go" Button e.g. you can trigger the callback  only  if one of those fields is at focus. Nor  hiCreateCombField  or  hiCreateButton  posses arguments which could mimic this functionality. ( Yes,  hiCreateComboField  has   ?focusInCallback  , but it's triggered immediately when field gets in focus. )   


     
    hiCreateButton (
       ...
       ?callback g_callback
       ...
    )    
        

    hiCreateComboField (    
      ...    
      ?callback g_callback    
      ?modifyCallback g_modifyCallback    
      ?focusInCallback g_focusInCallback  
      ...    
    )  

      There should be way to trigger a CB in window form when those two criteria are met: 1) Field in focus & 2) Main Enter Key is pressed 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to FlxZer
    FlxZer said:
    There should be way to trigger a CB in window form when those two criteria are met: 1) Field in focus & 2) Main Enter Key is pressed

    There isn't though (regardless of whether it's a window form or a standard form) - there's no field-specific enter callback. On standard (non-window) forms, enter (or return) triggers the form callback (can't double check as I don't have a numeric keypad on my keyboard), and for window forms it doesn't do anything unless you define a bindkey - which can't be field-specific.

    However, one approach you could possibly take is to define a bindkey for your window form and then use:

    hiGetKeyboardFocusField(yourForm)

    to retrieve the name of the current focus field. Then you can do a specific action based on which field is in focus in the callback (e.g. with a case() function)

    Does that solve it for you?

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • 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