bool keyboard_KeyReleased(KeyEvent arg) { if (arg.key.Equals(KeyCode.KC_ESCAPE)) { CloseControlChangeWindow(); return(false); } String langKey = GetLanguageKeyById(currentKeyId); // check for conflicts if (!langKey.Equals(LanguageKey.Pitch) && !langKey.Equals(LanguageKey.AccelerateBreakTurn)) { if (KeyMap.CheckKeyCodeConflict(langKey, arg.key, TypeOfControl.Keyboard)) { // handle return(true); } } // keys if (langKey.Equals(LanguageKey.Engine)) { KeyMap.Instance.Engine = arg.key; } if (langKey.Equals(LanguageKey.Spin)) { KeyMap.Instance.Spin = arg.key; } if (langKey.Equals(LanguageKey.Gear)) { KeyMap.Instance.Gear = arg.key; } if (langKey.Equals(LanguageKey.Gun)) { KeyMap.Instance.Gun = arg.key; } if (langKey.Equals(LanguageKey.Bombs)) { KeyMap.Instance.Bombs = arg.key; } if (langKey.Equals(LanguageKey.Camera)) { KeyMap.Instance.Camera = arg.key; } if (langKey.Equals(LanguageKey.Zoomin)) { KeyMap.Instance.ZoomIn = arg.key; } if (langKey.Equals(LanguageKey.Zoomout)) { KeyMap.Instance.ZoomOut = arg.key; } if (langKey.Equals(LanguageKey.BulletTimeEffect)) { KeyMap.Instance.BulletTimeEffect = arg.key; } // pitch if (langKey.Equals(LanguageKey.Pitch)) { if (twoStep == 1) { if (KeyMap.CheckKeyCodeConflict("Up", arg.key, TypeOfControl.Keyboard, new [] { "Down" })) { return(true); } twoStep++; KeyMap.Instance.Up = arg.key; controlChangeWindow.createStaticText(new Vector4(GUI.OVERLAY_TITLE_MARGIN, GUI.OVERLAY_TITLE_MARGIN + parentGui.mFontSize * 2, controlChangeWindow.w, parentGui.mFontSize), KeyMap.Instance.Up.ToString(), new ColourValue(0.9f, 0.7f, 0.0f)); controlChangeWindow.createStaticText(new Vector4(GUI.OVERLAY_TITLE_MARGIN, GUI.OVERLAY_TITLE_MARGIN + parentGui.mFontSize * 3, controlChangeWindow.w, parentGui.mFontSize), LanguageResources.GetString(LanguageKey.Pitch) + " (2/2)"); return(true); // only first step } else { twoStep = 1; if (KeyMap.CheckKeyCodeConflict("Down", arg.key, TypeOfControl.Keyboard, new [] { "Up" })) { return(true); } KeyMap.Instance.Down = arg.key; // finish } } if (langKey.Equals(LanguageKey.AccelerateBreakTurn)) { if (twoStep == 1) { if (KeyMap.CheckKeyCodeConflict("Left", arg.key, TypeOfControl.Keyboard, new [] { "Right" })) { return(true); } twoStep++; KeyMap.Instance.Left = arg.key; controlChangeWindow.createStaticText(new Vector4(GUI.OVERLAY_TITLE_MARGIN, GUI.OVERLAY_TITLE_MARGIN + parentGui.mFontSize * 2, controlChangeWindow.w, parentGui.mFontSize), KeyMap.Instance.Left.ToString(), new ColourValue(0.9f, 0.7f, 0.0f)); controlChangeWindow.createStaticText(new Vector4(GUI.OVERLAY_TITLE_MARGIN, GUI.OVERLAY_TITLE_MARGIN + parentGui.mFontSize * 3, controlChangeWindow.w, parentGui.mFontSize), LanguageResources.GetString(LanguageKey.AccelerateBreakTurn) + " (2/2)"); return(true); // only first step } else { twoStep = 1; if (KeyMap.CheckKeyCodeConflict("Right", arg.key, TypeOfControl.Keyboard, new [] { "Left" })) { // handle return(true); } KeyMap.Instance.Right = arg.key; // finish } } KeyMap.Instance.Value = KeyMap.Instance.Value; CloseControlChangeWindow(); // notify parent to refresh if (onControlsChanged != null) { onControlsChanged(); } return(true); }