Simulate a key been Held down when it isn't in Unity...

I know you can’t simulate key presses in Unity,
but I’m hoping you can do this…

I have a button in my GUI menu (an editor extension)
and when this button is clicked (turned on)
when the control key is pressed it will simulate it been
held down.

This will happend until the toggle button is switched off
or maybe if the control key is pressed again.

I know how to detect the intial key press, but how to then simulate it been
held down until key is detected again or the toggle is switched off I don’t know.

Any ideas?

Thanks
Chris.

1 Answer

1

Not quite sure what you are trying to make, but perhaps you could use a TOGGLE button instead?

http://unity3d.com/support/documentation/ScriptReference/30_search.html?q=gui.toggle