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

    CoreMessage & Modal Dialog

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 433 Views
    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 Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 07/12/2006 at 19:46, xxxxxxxx wrote:

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

      ---------
      Hi ... everbody ...

      In my dialog plugin, when the user press a button I open another dialog and it's a modal(synchronous) dialog ... let's call it sub-dialog ...
      I want to trace the key user is pressing in that sub-dialg ... bcos ... for example if the user press ESC ... I want to close that sub-dialog or if UP-DOWN arrows ... I want to do some other procedures ... But at that time the code in the CoreMessage function of that sub-dialog is not working at all ... after calling the CreateLayout function ...
      How can I solve the problem ...?
      Can I use the CoreMessage function to trace the user's keys ...?

      Hoping you'll do me a favor ... 🙂
      Zaw Min Tun

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 07/12/2006 at 23:27, xxxxxxxx wrote:

        CoreMessage() really isn't the method to use. Supposedly (and I can't get it to work) you can check for BFM_INPUT messages to the dialog's Message() method. Even printing whenever Message() is called, nothing happens when, say, I bang on the ESC key repeatedly. This doesn't bode well for the doc-explained functionality and reality... 😉

        Since that doesn't seem to work, a possible solution is to set up the virtual method Timer() and call SetTimer(). This will start a timer at the interval specified. In Timer() you can then call GetInputEvent() for the Keyboard and check the keys that it contains.

        // GeDialog.Timer
        //*---------------------------------------------------------------------------*
        void Timer(const BaseContainer& msg)
        //*---------------------------------------------------------------------------*
        {
             BaseContainer     res;
             if (GetInputEvent(BFM_INPUT_KEYBOARD, res))      Close(FALSE);
        }

        Call SetTimer(500); at the end of CreateLayout() to get it started. Note that I'm not checking for specific keys. See Input Events in the docs for more on that.

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 08/12/2006 at 00:18, xxxxxxxx wrote:

          Thanks Robert ...

          I tried the code and I found that ...
          GetInputEvent function is just returning TRUE if I'm pressing a key or not ...
          If I try to check res.GetLong(BFM_INPUT_CHANNEL)==KEY_XXX ... I cannot do it ... it is always -1 ...

          Surley I put the SetTimer(500) at the end of the CreateLayout function ...

          Anyway ... I really thank you a lot for your sharing ...

          Zaw Min Tun

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 08/12/2006 at 01:38, xxxxxxxx wrote:

            Yep, I found the same. It doesn't even change the msg ID if you hit a key (always -1 as you note). It seems to me (and the lack of information on this forum) that GeModalDialog() cannot process key events whatsoever - they do not come in through CoreMessage(), Message(), Command(), or Timer() - ever! It'd be great if anyone can contradict this - but I expect to hear crickets. 🙂

            Note to Maxon - your keyboard support (la)cks. I've seen better keyboard support in old MSDOS GUIs (mine, for instance!). Have you ever considered figuring out why this is so (and telling us so that we can actually use keys)?

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

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 08/12/2006 at 02:45, xxxxxxxx wrote:

              😉

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