Jump to content

Any way to stop the clickthrough


linuxgurugamer

Recommended Posts

I'm trying to open a dialog which will essentially lock the rest of the screen until it is closed.

I tried making it cover the entire screen, but the mouse click still goes through to what's behind (clickthrough).

so, two questions:

1. Is there an easy way to lock the entire screen?

2. How can I prevent the click-through

Thanks

Link to comment
Share on other sites

If i understood you right you want to lock the kerbal ui. Try using the InputLockManager:

 InputLockManager.SetControlLock(ControlTypes.All, "lockID");

This will lock the entire ui. Set it once your window appears or the cursor enters the window.

And once you are done:

InputLockManager.RemoveControlLock("lockID");

.

Link to comment
Share on other sites

If i understood you right you want to lock the kerbal ui. Try using the InputLockManager:

 InputLockManager.SetControlLock(ControlTypes.All, "lockID");

This will lock the entire ui. Set it once your window appears or the cursor enters the window.

And once you are done:

InputLockManager.RemoveControlLock("lockID");

.

That's almost perfect, thanks.

Is there any way to merely lock all except my window? What I'd like to happen, is that when the Escape key is pressed, to open my window and lock everything else. I'd like them to be able to leave my window either by typing another Escape or by pressing a button on my window.

Thanks

Edited by linuxgurugamer
Link to comment
Share on other sites

That's almost perfect, thanks.

Is there any way to merely lock all except my window? What I'd like to happen, is that when the Escape key is pressed, to open my window and lock everything else. I'd like them to be able to leave my window either by typing another Escape or by pressing a button on my window.

Thanks

That's almost perfect, thanks.

Is there any way to merely lock all except my window? What I'd like to happen, is that when the Escape key is pressed, to open my window and lock everything else. I'd like them to be able to leave my window either by typing another Escape or by pressing a button on my window.

Thanks

You can try something like this:

private const ControlTypes BLOCK_ALL_CONTROLS = ControlTypes.ALL_SHIP_CONTROLS | ControlTypes.ACTIONS_ALL | ControlTypes.EVA_INPUT | ControlTypes.TIMEWARP | ControlTypes.MISC | ControlTypes.GROUPS_ALL | ControlTypes.CUSTOM_ACTION_GROUPS;
...more code...
InputLockManager.SetControlLock(BLOCK_ALL_CONTROLS, "mylock");
...
InputLockManager.RemoveControlLock("mylock");

Salud.

Link to comment
Share on other sites

That's almost perfect, thanks.

Is there any way to merely lock all except my window? What I'd like to happen, is that when the Escape key is pressed, to open my window and lock everything else. I'd like them to be able to leave my window either by typing another Escape or by pressing a button on my window.

Thanks

As far as i am aware your windows and any mods windows wont be locked by default. Except if they check the lock status.
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...