private void FormAreaSelectionTest_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { // press ESC to close the window case Keys.Escape: this.Close(); break; // press number keys to set gaze display mode case Keys.D1: gazeDisplayMode = GazeDisplayMode.None; break; case Keys.D2: gazeDisplayMode = GazeDisplayMode.Individal; break; case Keys.D3: gazeDisplayMode = GazeDisplayMode.Average; break; // press key S to show settings dialog case Keys.S: FormSettings f = new FormSettings("Area Selection Settings", this.settings); f.ShowDialog(this); break; case Keys.V: timerVirtualGazeTimer.Enabled = !timerVirtualGazeTimer.Enabled; break; } }
public void StopCalibration() { _sendRequestMessage(new Dictionary <string, object> { { "subject", "calibration.should_stop" } }); if (OnCalibrationDone != null) { OnCalibrationDone(this); } _setStatus(EStatus.ProcessingGaze); gazeDisplayMode = GazeDisplayMode.CenterEye; }
void OnGUI() { if (Input.GetKeyDown(KeyCode.K)) { displayUILog = true; } if (Input.GetKeyDown(KeyCode.L)) { displayUILog = false; } if (Input.GetKeyDown(KeyCode.Alpha1)) { gazeDisplayMode = GazeDisplayMode.LeftEye; } if (Input.GetKeyDown(KeyCode.Alpha2)) { gazeDisplayMode = GazeDisplayMode.RightEye; } if (Input.GetKeyDown(KeyCode.Alpha3)) { gazeDisplayMode = GazeDisplayMode.CenterEye; } if (Input.GetKeyDown(KeyCode.Alpha4)) { gazeDisplayMode = GazeDisplayMode.All; } if (Input.GetKeyDown(KeyCode.Alpha5)) { gazeDisplayMode = GazeDisplayMode.None; } String str = ""; str += "Capture Rate=" + _currentFps; str += "\nLeft Eye (Red):" + leftEye.gaze.ToString(); str += "\nRight Eye (Blue):" + rightEye.gaze.ToString(); str += "\nCenter Eye (Green):" + centerEye.ToString(); str += "\nRemaining calibration points:" + (DefaultCalibrationCount - _currCalibSamples); //str += "\nLooking at fixation point?:" + (checkEyeTrackingThreshold()? " YES" : " NO"); GUI.TextArea(new Rect(0, 0, 200, 6 * 17), str); }