PDA

View Full Version : Controlling the focus


Eugenio
02-13-2008, 08:43 PM
Hi all!

I just build a "Go to time" script today a la After Effects and combustion that creates a floating dialog that I enter the value, press enter and it closes. But when after that the focus goes somewhere else and shortcuts doesn't work until I click something...

So the question is, how can I bring the focus back to the viewport for shorcuts to work again after the dialog is closed? Couldn't find that in the help...

Thanks in advance...

Jr.

RustyKnight
02-14-2008, 12:35 AM
I don't know if this will help, but you could try setting the active viewport...viewport.activeviewport = 1or something like it...or you might be able to change the current command panel mode using something likemax create modeThis might be enough to draw focus

Shane

Eugenio
02-14-2008, 03:33 AM
Thanks for the answer...but I already tried the viewport thing and it didn't work, sorry for not advising...my bad...:sad:

Just to note, I tried to use #escape too with no sucess...

I will try your other suggestion... :)

Regards,

Jr.

Eugenio
02-21-2008, 05:49 PM
OK guys, now this thing got on my nerves. I can't get it to work on my own, I REALLY need some light here...

To resume the situation is that for an editable text when I enter something on it (and destroy de dialog via script after entered the text), I can't have the focus back to max until I right click the viewport. I tried everything I could think of with no sucess...

I just can't believe no one here knows a solution for that...any help are MUCH appreciated...

Regards,

Jr.

mir-vadim
02-26-2008, 08:07 PM
Hi
try this

try ( toolmode.commandmode = toolmode.commandmode) catch ()

this helped me.

Eugenio
02-28-2008, 12:49 AM
Hi
try this

try ( toolmode.commandmode = toolmode.commandmode) catch ()

this helped me.Hi mir-vadim! To me it's not working...WTF!!! I'm already giving up on this one...

I did a simple test that shows pretty well the problem (After you entered the value, shortcuts no longer work until I rightclick the viewport (must be in the viewport)):
macroScript Macro1
category:"DragAndDrop"
toolTip:""
(
rollout unnamedRollout "Untitled" width:160 height:32
(
editText edt1 "Go To Time" pos:[8,8] width:144 height:16
on edt1 entered text do
(
sliderTime += text as time
destroyDialog unnamedRollout
toolmode.commandmode = toolmode.commandmode
)
)
createDialog unnamedRollout
setFocus unnamedRollout.edt1
)

CGTalk Moderation
02-28-2008, 12:49 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.