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

    GetInputEvent - Enter Key

    PYTHON Development
    0
    2
    352
    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/09/2014 at 17:21, xxxxxxxx wrote:

      I have a script / command plugin. On the main dialog is a text edit field, and a save button. How would I capture the input event of the enter key while in the dialog and have that run commands?

      Thanks,
      Joe

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

        On 16/09/2014 at 03:17, xxxxxxxx wrote:

        Hello,

        It seems there is no special Event triggered when "Enter" was pressed. But you can check if "Enter" is pressed:

          
          def Message(self, msg, result) :  
          
              bc = c4d.BaseContainer()  
              ok = c4d.gui.GetInputState(c4d.BFM_INPUT_KEYBOARD,c4d.KEY_ENTER, bc)  
              if ok:  
                  if bc[c4d.BFM_INPUT_VALUE] == 1:  
                      print ("Enter is pressed!")  
                
              return super(MyDialog, self).Message(msg,result)  
        

        GetInputState [URL-REMOVED]let's you check any keyboard or mouse property. The "Enter" key is defined via c4d.KEY_ENTER[URL-REMOVED]. If the BFM_INPUT_VALUE[URL-REMOVED] is 1 the key is pressed.

        Best wishes,
        Sebastian


        [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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