/// <summary> /// Processes keyboard input. /// </summary> private void processKeyInput() { if (!Input.anyKeyDown) { return; } // Fix for a bug in Linux where typing would still control game elements even if // a textbox was focused. if (GUIUtility.keyboardControl != 0) { return; } // process any key input for settings if (waitForKey) { KeyCode key = NodeTools.fetchKey(); // if the time is up or we have no key to process, reset. if (((keyWaitTime + 5.0) < Planetarium.GetUniversalTime()) || key == KeyCode.None) { currentWaitKey = Key.NONE; waitForKey = false; return; } // which key are we waiting for? switch (currentWaitKey) { case Key.PROGINC: options.progInc = key; break; case Key.PROGDEC: options.progDec = key; break; case Key.NORMINC: options.normInc = key; break; case Key.NORMDEC: options.normDec = key; break; case Key.RADIINC: options.radiInc = key; break; case Key.RADIDEC: options.radiDec = key; break; case Key.TIMEINC: options.timeInc = key; break; case Key.TIMEDEC: options.timeDec = key; break; case Key.PAGEINC: options.pageIncrement = key; break; case Key.PAGECON: options.pageConics = key; break; case Key.HIDEWINDOW: options.hideWindow = key; break; case Key.ADDWIDGET: options.addWidget = key; break; } currentWaitKey = Key.NONE; waitForKey = false; return; } // process normal keyboard input // change increment if (Input.GetKeyDown(options.pageIncrement)) { if (Event.current.alt) { options.downIncrement(); } else { options.upIncrement(); } } // prograde increment if (Input.GetKeyDown(options.progInc)) { curState.addPrograde(options.increment); } // prograde decrement if (Input.GetKeyDown(options.progDec)) { curState.addPrograde(-options.increment); } // normal increment if (Input.GetKeyDown(options.normInc)) { curState.addNormal(options.increment); } // normal decrement if (Input.GetKeyDown(options.normDec)) { curState.addNormal(-options.increment); } // radial increment if (Input.GetKeyDown(options.radiInc)) { curState.addRadial(options.increment); } // radial decrement if (Input.GetKeyDown(options.radiDec)) { curState.addRadial(-options.increment); } // UT increment if (Input.GetKeyDown(options.timeInc)) { curState.addUT(options.increment * (options.largeUTIncrement ? 10.0 : 1.0)); } // UT decrement if (Input.GetKeyDown(options.timeDec)) { curState.addUT(-options.increment * (options.largeUTIncrement ? 10.0 : 1.0)); } // Page Conics if (Input.GetKeyDown(options.pageConics)) { options.pageConicsMode(); } // hide/show window if (Input.GetKeyDown(options.hideWindow)) { shown = !shown; } // open node gizmo if (Input.GetKeyDown(options.addWidget)) { curState.node.CreateNodeGizmo(); } }