Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Focus [SOLVED]

    SDK Help
    0
    3
    355
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 12/01/2017 at 04:18, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R14 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi Folks,

      I'm trying to implement a simple "enter" key press in a dialog edit text field. Is this possible!? Can I (or how can I..) test if a dialog gui element has focus in the dialog's Command() or Message()?

      An example is the content browser search, which appears to do something similar. You can type but won't search until enter is pressed. I'm trying to do something similar.

      Cheers,

      WP.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 13/01/2017 at 01:23, xxxxxxxx wrote:

        Hello,

        when a gadget of a GeDialog is edited, GeDialog::Command() is called. By implementing GeDialog::Command() you can react to interactions with a certain gadget.

        So when a text edit field is changed by pressing the enter key, GeDialog::Command() is called. Then you can check if the Enter key is pressed with GetInputState(). So when the enter is is pressed, you can react accordingly.

        You find an example of this in the GeDialog Manual.

        best wishes,
        Sebastian

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 13/01/2017 at 17:20, xxxxxxxx wrote:

          Hi Seb,

          I had tried this before, but it wasn't working. Strangely enough it would print from the Command() id but not read the key press? That's what was confusing me.

          I then made some changes to the interface, the edit text field is now in a 'tab' and the user can make as many tabs as they like. But I forgot to update the Command() for the change in id + tab number. In short, I wasn't looking at the right id 🙂

          Solved! As always, thanks,

          WP.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post