Here are the examples of the csharp api class UnityEngine.Input.GetKeyDown(UnityEngine.KeyCode) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
200 Examples
14
1. Example
Project: Blog
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
2. Example
Project: HoloViveObserver
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
3. Example
Project: Blog
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
4. Example
Project: Blog
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
5. Example
Project: Blog
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
6. Example
Project: Blog
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
7. Example
Project: Blog
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
8. Example
Project: Blog
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
9. Example
Project: Blog
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
10. Example
Project: Blog
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
11. Example
Project: Blog
Source File: InputSourceKeyboard.cs
Source File: InputSourceKeyboard.cs
public static bool GetKeyDown(KeyCode keyCode) { return Input.GetKeyDown(keyCode); }
0
12. Example
Project: Blog
Source File: Sequencer.cs
Source File: Sequencer.cs
public void FixedUpdate() { if (Input.GetKeyDown(SkipStepButton)) { } if (Input.GetKeyDown(RepeatStepButton)) { } if (Input.GetKeyDown(ResetButton)) { } }
0
13. Example
Project: Blog
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
14. Example
Project: Blog
Source File: InputSourceKeyboard.cs
Source File: InputSourceKeyboard.cs
public static bool GetKeyDown(KeyCode keyCode) { return Input.GetKeyDown(keyCode); }
0
15. Example
Project: Blog
Source File: Sequencer.cs
Source File: Sequencer.cs
public void FixedUpdate() { if (Input.GetKeyDown(SkipStepButton)) { } if (Input.GetKeyDown(RepeatStepButton)) { } if (Input.GetKeyDown(ResetButton)) { } }
0
16. Example
Project: Illusion-Plugins
Source File: OVRCrosshair.cs
Source File: OVRCrosshair.cs
bool ShouldDisplayCrosshair() { if(Input.GetKeyDown (CrosshairKey)) { if(DisplayCrosshair == false) { DisplayCrosshair = true; // Always initialize screen location of cursor to center XL = ScreenWidth * 0.5f; YL = ScreenHeight * 0.5f; } else DisplayCrosshair = false; } return DisplayCrosshair; }
0
17. Example
Project: Illusion-Plugins
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
void UpdateRecenterPose() { if(Input.GetKeyDown(KeyCode.R)) { OVRManager.display.RecenterPose(); } }
0
18. Example
Project: Illusion-Plugins
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
void UpdateVisionMode() { if (Input.GetKeyDown(KeyCode.F2)) { VisionMode = !VisionMode; OVRManager.tracker.isEnabled = VisionMode; #if SHOW_DK2_VARIABLES strVisionMode = VisionMode ? "Vision Enabled: ON" : "Vision Enabled: OFF"; #endif } }
0
19. Example
Project: Illusion-Plugins
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
bool ShowLevels() { if (Scenes.Length == 0) { ScenesVisible = false; return ScenesVisible; } bool curStartDown = OVRGamepadController.GPC_GetButton(OVRGamepadController.Button.Start); bool startPressed = (curStartDown && !PrevStartDown) || Input.GetKeyDown(KeyCode.RightShift); PrevStartDown = curStartDown; if (startPressed) { ScenesVisible = !ScenesVisible; } return ScenesVisible; }
0
20. Example
Project: Illusion-Plugins
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
int GetCurrentLevel() { bool curHatDown = false; if(OVRGamepadController.GPC_GetButton(OVRGamepadController.Button.Down) == true) curHatDown = true; bool curHatUp = false; if(OVRGamepadController.GPC_GetButton(OVRGamepadController.Button.Down) == true) curHatUp = true; if((PrevHatDown == false) && (curHatDown == true) || Input.GetKeyDown(KeyCode.DownArrow)) { CurrentLevel = (CurrentLevel + 1) % SceneNames.Length; } else if((PrevHatUp == false) && (curHatUp == true) || Input.GetKeyDown(KeyCode.UpArrow)) { CurrentLevel--; if(CurrentLevel < 0) CurrentLevel = SceneNames.Length - 1; } PrevHatDown = curHatDown; PrevHatUp = curHatUp; return CurrentLevel; }
0
21. Example
Project: Illusion-Plugins
Source File: OVRCrosshair.cs
Source File: OVRCrosshair.cs
bool ShouldDisplayCrosshair() { if(Input.GetKeyDown (CrosshairKey)) { if(DisplayCrosshair == false) { DisplayCrosshair = true; // Always initialize screen location of cursor to center XL = ScreenWidth * 0.5f; YL = ScreenHeight * 0.5f; } else DisplayCrosshair = false; } return DisplayCrosshair; }
0
22. Example
Project: Illusion-Plugins
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
void UpdateRecenterPose() { if(Input.GetKeyDown(KeyCode.R)) { OVRManager.display.RecenterPose(); } }
0
23. Example
Project: Illusion-Plugins
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
void UpdateVisionMode() { if (Input.GetKeyDown(KeyCode.F2)) { VisionMode = !VisionMode; OVRManager.tracker.isEnabled = VisionMode; #if SHOW_DK2_VARIABLES strVisionMode = VisionMode ? "Vision Enabled: ON" : "Vision Enabled: OFF"; #endif } }
0
24. Example
Project: Illusion-Plugins
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
bool ShowLevels() { if (Scenes.Length == 0) { ScenesVisible = false; return ScenesVisible; } bool curStartDown = OVRGamepadController.GPC_GetButton(OVRGamepadController.Button.Start); bool startPressed = (curStartDown && !PrevStartDown) || Input.GetKeyDown(KeyCode.RightShift); PrevStartDown = curStartDown; if (startPressed) { ScenesVisible = !ScenesVisible; } return ScenesVisible; }
0
25. Example
Project: Illusion-Plugins
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
int GetCurrentLevel() { bool curHatDown = false; if(OVRGamepadController.GPC_GetButton(OVRGamepadController.Button.Down) == true) curHatDown = true; bool curHatUp = false; if(OVRGamepadController.GPC_GetButton(OVRGamepadController.Button.Down) == true) curHatUp = true; if((PrevHatDown == false) && (curHatDown == true) || Input.GetKeyDown(KeyCode.DownArrow)) { CurrentLevel = (CurrentLevel + 1) % SceneNames.Length; } else if((PrevHatUp == false) && (curHatUp == true) || Input.GetKeyDown(KeyCode.UpArrow)) { CurrentLevel--; if(CurrentLevel < 0) CurrentLevel = SceneNames.Length - 1; } PrevHatDown = curHatDown; PrevHatUp = curHatUp; return CurrentLevel; }
0
26. Example
Project: Memoria
Source File: Input.cs
Source File: Input.cs
public static Boolean GetKeyDown(KeyCode keyName) { return UnityEngine.Input.GetKeyDown(keyName); }
0
27. Example
Project: CubeWorld
Source File: GUIStatePlayerInventory.cs
Source File: GUIStatePlayerInventory.cs
public override void ProcessKeys() { if (Input.GetKeyDown(KeyCode.B)) playerGUI.ExitInventory(); }
0
28. Example
Project: CubeWorld
Source File: GUIStatePlayerNormal.cs
Source File: GUIStatePlayerNormal.cs
public override void ProcessKeys() { for (int i = (int)KeyCode.Alpha1; i <= (int)KeyC/n ..... /n //View Source file for more details /n }
0
29. Example
Project: ModAPI
Source File: ConsoleComponent.cs
Source File: ConsoleComponent.cs
void Update() { if (UnityEngine.Input.GetKeyDown(KeyCode.BackQuote) || UnityEngine.Input.GetKeyDown(KeyCode.Backslash)) { ModAPI.Console.Switch(); } }
0
30. Example
Project: Yugioh-For-HoloLens
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
31. Example
Project: UWO
Source File: TestController.cs
Source File: TestController.cs
void ChangeMode() { if (Input.GetKeyDown(KeyCode.Keypad1) || Input.GetKeyDown(KeyCode.Alpha1)) { fireMode = FireMode.FireBullet; } if (Input.GetKeyDown(KeyCode.Keypad2) || Input.GetKeyDown(KeyCode.Alpha2)) { fireMode = FireMode.CreateBlock; } if (Input.GetKeyDown(KeyCode.Keypad3) || Input.GetKeyDown(KeyCode.Alpha3)) { fireMode = FireMode.DeleteBlock; } if (Input.GetKeyDown(KeyCode.Keypad4) || Input.GetKeyDown(KeyCode.Alpha4)) { fireMode = FireMode.ChangeBlockColor; } switch (fireMode) { case FireMode.FireBullet: GlobalGUI.SetTool("BULLET"); break; case FireMode.CreateBlock: GlobalGUI.SetTool("+BLOCK"); break; case FireMode.DeleteBlock: GlobalGUI.SetTool("-BLOCK"); break; case FireMode.ChangeBlockColor: GlobalGUI.SetTool("COLOR"); break; } }
0
32. Example
Project: UWO
Source File: ToggleLight.cs
Source File: ToggleLight.cs
void Update() { if (Input.GetKeyDown(key) && !GlobalState.isInputting) { light.enabled = !light.enabled; } }
0
33. Example
Project: StereoAR-for-Unity
Source File: OVRCrosshair.cs
Source File: OVRCrosshair.cs
bool ShouldDisplayCrosshair() { if(Input.GetKeyDown (KeyCode.C)) { if(DisplayCrosshair == false) { DisplayCrosshair = true; // Always initialize screen location of cursor to center XL = ScreenWidth * 0.5f; YL = ScreenHeight * 0.5f; } else DisplayCrosshair = false; } return DisplayCrosshair; }
0
34. Example
Project: StereoAR-for-Unity
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
void UpdateDistortionCoefs() { float Dk0 = 0.0f; float Dk1 = 0.0f; float Dk2 = 0.0f; float Dk3 = 0.0f; // * * * * * * * * * // Get the distortion coefficients to apply to shader CameraController.GetDistortionCoefs(ref Dk0, ref Dk1, ref Dk2, ref Dk3); if(Input.GetKeyDown(KeyCode.Alpha1)) Dk1 -= DistKIncrement; else if (Input.GetKeyDown(KeyCode.Alpha2)) Dk1 += DistKIncrement; if(Input.GetKeyDown(KeyCode.Alpha3)) Dk2 -= DistKIncrement; else if (Input.GetKeyDown(KeyCode.Alpha4)) Dk2 += DistKIncrement; CameraController.SetDistortionCoefs(Dk0, Dk1, Dk2, Dk3); //if(ShowVRVars == true)// limit gc // strDistortion = // System.String.Format ("DST k1: {0:F3} k2 {1:F3}", Dk1, Dk2); }
0
35. Example
Project: StereoAR-for-Unity
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
bool ShowLevels() { if(Scenes.Length == 0) { ScenesVisible = false; return ScenesVisible; } bool curStartDown = false; if(OVRGamepadController.GPC_GetButton((int)OVRGamepadController.Button.Start) == true) curStartDown = true; if((PrevStartDown == false) && (curStartDown == true) || Input.GetKeyDown(KeyCode.RightShift) ) { if(ScenesVisible == true) ScenesVisible = false; else ScenesVisible = true; } PrevStartDown = curStartDown; return ScenesVisible; }
0
36. Example
Project: StereoAR-for-Unity
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
int GetCurrentLevel() { bool curHatDown = false; if(OVRGamepadController.GPC_GetButton((int)OVRGamepadController.Button.Down) == true) curHatDown = true; bool curHatUp = false; if(OVRGamepadController.GPC_GetButton((int)OVRGamepadController.Button.Down) == true) curHatUp = true; if((PrevHatDown == false) && (curHatDown == true) || Input.GetKeyDown(KeyCode.DownArrow)) { CurrentLevel = (CurrentLevel + 1) % SceneNames.Length; } else if((PrevHatUp == false) && (curHatUp == true) || Input.GetKeyDown(KeyCode.UpArrow)) { CurrentLevel--; if(CurrentLevel < 0) CurrentLevel = SceneNames.Length - 1; } PrevHatDown = curHatDown; PrevHatUp = curHatUp; return CurrentLevel; }
0
37. Example
Project: StereoAR-for-Unity
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
void UpdateResetOrientation() { if( ((ScenesVisible == false) && (OVRGamepadController.GPC_GetButton((int)OVRGamepadController.Button.Down) == true)) || (Input.GetKeyDown(KeyCode.B) == true) ) { OVRDevice.ResetOrientation(0); } }
0
38. Example
Project: uREPL
Source File: Key.cs
Source File: Key.cs
public static bool Enter() { return Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter); }
0
39. Example
Project: uREPL
Source File: KeyBinding.cs
Source File: KeyBinding.cs
private void ToggleWindowByKeys() { if (openKey == closeKey) { if (Input.GetKeyDown(openKey)) { if (!window_.isOpen) window_.Open(); else window_.Close(); } } else { if (Input.GetKeyDown(openKey)) window_.Open(); if (Input.GetKeyDown(closeKey)) window_.Close(); } }
0
40. Example
Project: unite-12
Source File: Exploder.cs
Source File: Exploder.cs
void Update () { if (Input.GetKeyDown(KeyCode.Space)) { WallController.Explode(); } }
0
41. Example
Project: MolecularRift
Source File: OVRCrosshair.cs
Source File: OVRCrosshair.cs
bool ShouldDisplayCrosshair() { if(Input.GetKeyDown (CrosshairKey)) { if(DisplayCrosshair == false) { DisplayCrosshair = true; // Always initialize screen location of cursor to center XL = ScreenWidth * 0.5f; YL = ScreenHeight * 0.5f; } else DisplayCrosshair = false; } return DisplayCrosshair; }
0
42. Example
Project: MolecularRift
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
void UpdateRecenterPose () { if (Input.GetKeyDown (KeyCode.R)) { OVRManager.display.RecenterPose (); } }
0
43. Example
Project: MolecularRift
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
void UpdateVisionMode () { if (Input.GetKeyDown (KeyCode.F2)) { VisionMode = !VisionMode; OVRManager.tracker.isEnabled = VisionMode; #if SHOW_DK2_VARIABLES strVisionMode = VisionMode ? "Vision Enabled: ON" : "Vision Enabled: OFF"; #endif } }
0
44. Example
Project: MolecularRift
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
bool ShowLevels () { if (Scenes.Length == 0) { ScenesVisible = false; return ScenesVisible; } bool curStartDown = OVRGamepadController.GPC_GetButton (OVRGamepadController.Button.Start); bool startPressed = (curStartDown && !PrevStartDown) || Input.GetKeyDown (KeyCode.RightShift); PrevStartDown = curStartDown; if (startPressed) { ScenesVisible = !ScenesVisible; } return ScenesVisible; }
0
45. Example
Project: MolecularRift
Source File: OVRMainMenu.cs
Source File: OVRMainMenu.cs
int GetCurrentLevel () { bool curHatDown = false; if (OVRGamepadController.GPC_GetButton (OVRGamepadController.Button.Down) == true) curHatDown = true; bool curHatUp = false; if (OVRGamepadController.GPC_GetButton (OVRGamepadController.Button.Down) == true) curHatUp = true; if ((PrevHatDown == false) && (curHatDown == true) || Input.GetKeyDown (KeyCode.DownArrow)) { CurrentLevel = (CurrentLevel + 1) % SceneNames.Length; } else if ((PrevHatUp == false) && (curHatUp == true) || Input.GetKeyDown (KeyCode.UpArrow)) { CurrentLevel--; if (CurrentLevel < 0) CurrentLevel = SceneNames.Length - 1; } PrevHatDown = curHatDown; PrevHatUp = curHatUp; return CurrentLevel; }
0
46. Example
Project: MRDesignLabs_Unity
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
47. Example
Project: MRDesignLabs_Unity
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
48. Example
Project: Holographic-Photo-Project
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
49. Example
Project: MixedRealityCompanionKit
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }
0
50. Example
Project: MRDesignLabs_Unity_LunarModule
Source File: KeywordManager.cs
Source File: KeywordManager.cs
private void ProcessKeyBindings() { foreach (var kvp in KeywordsAndResponses) { if (Input.GetKeyDown(kvp.KeyCode)) { kvp.Response.Invoke(); return; } } }