Search Unity

Input Inactive In EditorWindow??

Discussion in 'Scripting' started by oldbushie, Apr 4, 2012.

  1. oldbushie

    oldbushie

    Joined:
    Mar 30, 2012
    Posts:
    24
    After a lot of searching, I found out that apparently there's no way to access Input from inside an EditorWindow. I'm trying to make a custom tool of ours distinguish between left mouse clicks or right mouse clicks but the closest I can get is EventType.ContextClick. This doesn't help to prevent right-mouse button drag selections though. Is there any other way to find the current state of the mouse or keyboard from inside an EditorWindow? I also have some key presses happening but I'd like to distinguish between down and up.
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Event.current.button, Event.current.type == EventType.KeyDown, Event.current.type == EventType.KeyUp.

    --Eric
     
  3. oldbushie

    oldbushie

    Joined:
    Mar 30, 2012
    Posts:
    24
    Thanks, guess I just wasn't searching hard enough in what Event has.