Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Can I get the typing (input) event in cinema 4d?

    Cinema 4D SDK
    windows python 2024
    2
    3
    529
    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.
    • gheyretG
      gheyret
      last edited by

      Hi everyone!
      I am currently trying to capture keyboard shortcuts using a third-party Python library.
      While I can successfully detect global hotkeys, I've encountered an issue where the hotkey (for instance, "a" in this case) triggers the corresponding code execution even when I'm typing(rename an object, searching something...e.t.c) within C4D.
      This means the hotkey event is captured regardless of the context, which has become a little bit complicated. I had not anticipated this behavior initially.

      So, I'm wondering if it's possible to specifically detect input events within C4D, so that I can skip the global hotkey detecting when typing.

      Another related issue is whether I can determine if the Cinema 4D window is currently active or not, because even when I'm working on other applications, the hotkey is still being monitored and triggered.

      www.boghma.com

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @gheyret
        last edited by

        Hey @gheyret,

        Thank you for reaching out to us.

        1. To capture input events you might want to have a look at the aptly named Input Events Manual. In principal you are capable of polling the global input event stream. But in some cases events are consumed before you can get hold of them (e.g., a user typing in Rename field) but that is probably what you want here. When you do not have a GeDialog or derived type, you likely want to use a thread to do the constant polling.
        2. If Cinema 4D is in focus or not, is not something that is exposed in the public API. You would have to use the respective OS libraries to do this yourself (or one of the popular wrappers for such stuff).

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        gheyretG 1 Reply Last reply Reply Quote 0
        • gheyretG
          gheyret @ferdinand
          last edited by

          Hi @ferdinand,
          Thank you for your reply.
          And I will try it later today.

          www.boghma.com

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