Pressing keys in the listener
Hi,
I am novice to the site and to maxscript.
I am using the pickobject() fn in a dotnet checkbox eventhandler function.
The problem is it works fine, if you select the picked object and not cancel the action.
If i know how to press the "escape" key in the listener i will be able to stop the function. I tried to use the "sendkeys" class with the "sendwait" method, but it only works as input in the listener.
Is there a way to press a key in a dialog (maxscript listener) by its HWND from a script.
Thanks
Tsvetan
Comments
Hi guys, I just tried the
Hi guys,
I just tried the code by anubis in order to print an "E" in the MAXScriptListener by sending the "{E}" key to it.
But, it doens't work. I only get this result:
Just in case the modified code looks like that:
Does anyone konw what's wrong?
I also don't understand what
local WM_ACTIVATE = 0x6
stands for..
Yes of course, it was helpful. I searched 2-3 days on the web for a way.
I believe we will meet again.
Thank you (Blagodarq)
*
*
Moved post to the right place.
welcome ;)
I think I forgot to say Welcome to the site and scripting, so I do it right now :)
Glad to know as well that I was helpful with something.
Anubis
my recent MAXScripts RSS (archive here)
Many Thanks, colleagues I
Many Thanks, colleagues
I write down the function body in my case to be much clear, if someone is searching on the web for a similar solution.
The "MCR_SendKeys" function is exactly what I am looking for.
pickObject prompt:"..." ?
Maybe you use the optional #prompt argument with pickObject(), which popup the Listener?
Its not very likeable option to me.
Here is a function anyway (right copy from my archive) for sending keys to the MacroRecorder sub-window (the pink area in the Listener dialog), but you can modify it to send keys to the main (white area) sub-window. If so, change the [2][1] in line "MacroChHWND = ..." to [1][1] (first sub-window).
I hope this helps
my recent MAXScripts RSS (archive here)
you can check if the obj is
you can check if the obj is undefined.
pickobject will return undefined when the action is cancelled.
Can't help you with the keys..