• 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 Design
  3. 2 Stroke bindkey or state machine bindkey application

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 127
  • Views 16115
  • 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

2 Stroke bindkey or state machine bindkey application

bharath2k4
bharath2k4 over 11 years ago

Hi ,

 

 I remember using 2 stroke bindkey previously in IC5.14. Now I have moved, and currently using IC6.1.5 version Will the state machine  or 2 stroke bindkey work?

example of a 2 storke bindkey:

1. Press key<a>,

2. It expects one more key/stroke to complete a bindkey operation

 

Press key <a> and

if we press  <q> - say move

if we press <w> - say  copy

<e> - say rotate and so on..

 

like wise , This is not pressing 2 keys at a time, but one after the other 

<q><a> - rotate;

<q><s> - operation2;

<q><d> -operation3;

<q><f> -operation4 

 

I am not sure if I am understandable, Pardon me if I am not. I can explain again.

 

Thanks,

Bharath 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    Hi Bharath,

    Given that this is not a standard feature of the tools, it can only have been available by implementing it in SKILL. There's no reason why you couldn't use the same SKILL in IC61X.

    I posted an example of how to implement this a while back - see this post.

    Kind Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • bharath2k4
    bharath2k4 over 11 years ago

    Hi Andrew,

     

    I expected your reply.Few things,

    1. I don't have the code used previously.

    2. I saw your post, before posting this and had few questions.

    Your script:

    1. I have loaded your script. Initially I saved it in the form of name.il and it did not work due to defun conflicts. Later I read your post carefully and found that I have to save the file with *.ils extention. what is the difference?

    2. I have tried an example of F.I.T and nothing happened. I typed f,i,t and there is no reaction from layout viewer. Below is the bindkey I tried.

     abSeqBindKey->set("Layout" "fit" "hiZoomAbsoluteScale(hiGetCurrentWindow() 0.9)")

    3. I did not get any error while loading or using, just that there is no response to the commands. Can you provide me some examples to verify?

    4. You were talking about complex state machines in that post. Did you by any chance try that?  

     

    Thanks for your reply, 

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    My guess is that you didn't also call:

     abSeqBindKey->initBindKeys("Layout")

    You must do this to initialize the system. Without this, any registered key sequences will have no effect - this redefines all the letter and number keys to call this system. That's why you didn't get any errors, because the registered key sequence was never triggered. I did both the initBindKeys and the "fit" definition shown above, and it then worked fine in IC613. 

    The .ils suffix is required because the code is SKILL++ code; it takes advantage of lexical scoping to allow local functions and data, and this will not work with a .il suffix.

    I did not try a "state machine" type approach. I think this would be more complex to implement (at least more complex to maintain and register particular key sequences, potentially).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Mwcaboose
    Mwcaboose over 11 years ago

    Andrew,

     So would the code listed in your link above also include modifier key functionality?

    The reason I ask, is that I'm trying a different keyboard, and I'd like to remap some keys to perform default Cadence bindkey functionality.  For example, Cadence default "Shift<m>" gives you Mirror X/Y adjustability inside the move command.

    I want the exact same functionality/options based on a Numpad 0(Shift functionality) + Numpad 6 for move.

    Could your code be tweaked to yield the desired effect? Is what I want a different issue?

    Thanks,
    Michael

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    I updated the other post that you appended to, but I see you've given more details in this one.

    You could use this selectively, by only defining key bindings on <Key>KP_0 etc. You could define your own function:

     defun(CCFnumpadBindKeys (appType)
        let((appRoot)
            appRoot=hiGetBindKeyInheritRoot(appType)
            when(appRoot
                for(ascii charToInt('\0) charToInt('\9)
                    hiSetBindKey(appRoot
                        strcat("<Key>KP_" intToChar(ascii))
                        sprintf(nil "abSeqBindKey->enter(\"%s\")"
                            intToChar(ascii))
                    )
                ) ; for
                hiSetBindKey(appRoot "Shift<Key>KP_0" "abSeqBindKey->enter(\"S\")")
                hiSetBindKey(appRoot "<Key>Escape" "abSeqBindKey->reset()")
            ) ; when appRoot
        ) ; let
    ) ; defun CCFnumpadBindKeys

    This defines shift-0 (on they numeric keypad as "S" for shift), and all the others as numbers. So then I can do:

    CCFnumpadBindKeys("Layout")
    abSeqBindKey->set("Layout"
      '(
        ("S6" "leHiMove()")
      )
    )

    Then shift-0 and then 6 will do a move.

    Regards,

    Andrew.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Mwcaboose
    Mwcaboose over 11 years ago

     Andrew,

     

    I guess what I meant to say is that I want the Keypad 0 key to function as a Shift key.  So inside the Move command, a "KP_0+ middle mouse" button functions the same as a "Shift+middle mouse" button.

     

    Example:

    KP_6/m starts the move command.  I have my data selected, and want to mirror it.  Instead of the default "Shift+middle mouse", I want a "KP_0"+middle mouse.

     

    Does that make sense?  Any solution?  Thank you for your reply.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    That's rather different from what you said earlier, and is not possible (either with my code or with bindkeys in general). Ordinary keys cannot be used as modifiers. Seems a pretty strange request!

    Regards,

    Andrew 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Mwcaboose
    Mwcaboose over 11 years ago

     Yeah, I'm sorry for any lack of clarity.  It was unintentional. I was afraid it wouldn't work.  And yes, a strange request, I agree.  I have an unusual keyboard that I'm trying out.  It places the numpad to the left of the alphabetical portion.  The thought was I could minimize having to take my hand off the mouse, and reduce left hand movement over the keyboard by customizing the keypad to handle the most common bindkeys.  The idea works great with the exception of my "strange request".

     Guess I'll have to devise another plan.

     Out of curiousity, is it a limitation of Cadence, or is something hard coded in the keyboard hardware that prevents the change?  We have a Cadence AE here onsite, and he said it couldn't be done, at least that he was aware of.  I wasn't prepared to give up so easily.

     

    Thanks for looking anyway.

    Cheers,

    Michael

     

    EDIT:   PS, Now I wonder, could the functionality of a Shift+MiddleMouse in a Move or Copy command be bound to 1 key?  Say I use M for move, and THEN press KP_0 to mirror the selected data, and each key press toggles/cycles through each orientation.  Would that work?

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    I'm not sure if it's a hardware limitation or an X limitation. I couldn't even get  xmodmap -e "add shift = KP_0" to have an effect (it shows up in xmodmap -pm but it doesn't work as a shift key still).

    For your "EDIT" (by the way, there are no notifiers sent for edits, so I could have easily missed that), there's nothing to stop you adding a bindkey for lxCmdShiftOptions() (shift middle mouse) and lxCmdOptions() (middle mouse).

    e.g.

    hiSetBindKey("Layout" "<Key>KP_0" "lxCmdShiftOptions()")
    hiSetBindKey("Layout" "<Key>KP_1" "lxCmdOptions()")

    You could limit them to only work in enter functions (such as move or copy) by using:

    hiSetBindKey("Layout" "<Key>KP_0EF" "lxCmdShiftOptions()")
    hiSetBindKey("Layout" "<Key>KP_1EF" "lxCmdOptions()")

    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