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
    • Register
    • Register
    • Login

    Detect CTRL + RightMouseButton in SceneHook

    Cinema 4D SDK
    r25 c++ 2023
    2
    3
    611
    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.
    • C4DSC
      C4DS
      last edited by C4DS

      As the topic title says, I am trying to detect a CTRL + RightMouseButton in a scenehook.
      I managed to get this working in R20, as was discussed here:

      https://developers.maxon.net/forum/topic/14149/detect-ctrl-rightmousebutton-in-scenehook

      Trying the same with version 2023, still using the same code:

      if (msg.GetInt32(BFM_INPUT_CHANNEL) == BFM_INPUT_MOUSERIGHT)
      {
      	BaseContainer keyChannels;
      	if (GetInputEvent(BFM_INPUT_KEYBOARD, keyChannels))
      	{
      		Bool ctrlModifier = (keyChannels.GetInt32(BFM_INPUT_QUALIFIER) & QCTRL) != 0;
      		if (ctrlModifier)
      		{
      			ApplicationOutput("SceneHook - MouseInput: RMB + CTRL was pressed");
      			return true;
      		}
      	}
      }
      

      Unfortunately, the 'GetInputEvent' does not seem to get any result.
      Tested with R25 and version 2023.1.3
      I am using priority value of 2001.

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by m_adam

        I did not tried since it's week-end, will do next week, but out of my head I would say it's the same issue you already encountered How to detect CTRL being pressed in a GeDialog use GetInputState instead of GetInputEvent.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 1
        • C4DSC
          C4DS
          last edited by

          Thanks for taking the time to respond, even during the weekend.
          I must say this is quite embarrassing: I already had forgotten about the response in the other thread, and it's not even 3 weeks old.
          I sincerely apologize for wasting your time with this duplicate thread.

          I can confirm the GetInputState is working fine, no need to waste more of your time trying it out.
          Thanks again.

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