CoreMessage & Modal Dialog
-
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 -
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.
-
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
-
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)?
-
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: