예제 #1
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		void InputDevice_KeyDown(object sender, InputDevice.KeyEventArgs e)
		{
			if (e.Key == Keys.F1) {
				//DevCon.Show( this );
			}

			if (e.Key == Keys.F2) {
				Parameters.ToggleVSync();
			}

			if (e.Key == Keys.F5) {
				Reload();
			}

			if (e.Key == Keys.F12) {
				GraphicsDevice.Screenshot();
			}

			if (e.Key == Keys.Escape) {
				Exit();
			}

			if (e.Key==Keys.P) {
				if (soundInstance==null) {
					Log.Message("Play sound");
					soundInstance	=	soundEffect.CreateInstance();
					soundInstance.Apply3D( listener, emitter );
					soundInstance.IsLooped	=	true;
					soundInstance.Play();
				} else {
					soundInstance.Play();
				}
			}
			if (e.Key==Keys.I && soundInstance!=null) {
				soundInstance.Stop(false);
			}
			if (e.Key==Keys.O && soundInstance!=null) {
				var state = soundInstance.State;

				if (state==SoundState.Paused) {
					soundInstance.Resume();
				}
				if (state==SoundState.Playing) {
					soundInstance.Pause();
				}
			}
			if (e.Key==Keys.U && soundInstance!=null) {
				soundInstance.Stop(true);
			}

			if (e.Key==Keys.B) {
				soundEffectBite.Play();
			}
		}
예제 #2
0
파일: InputDemo.cs 프로젝트: temik911/audio
 void InputDevice_MouseScroll( object sender, InputDevice.MouseScrollEventArgs e )
 {
     Log.Message("...mouse scroll event : {0}", e.WheelDelta );
     scrollValue += e.WheelDelta;
 }
예제 #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void InputDevice_KeyDown( object sender, InputDevice.KeyEventArgs e )
        {
            if (e.Key == Keys.F1) {
                DevCon.Show(this);
            }

            if (e.Key == Keys.F2) {
                Parameters.VSyncInterval = (Parameters.VSyncInterval == 0) ? 1 : 0;
            }

            if (e.Key == Keys.F5) {
                Reload();
            }

            if (e.Key == Keys.F12) {
                GraphicsDevice.Screenshot();
            }

            if (e.Key == Keys.Escape) {
                Exit();
            }
        }
예제 #4
0
파일: InputDemo.cs 프로젝트: temik911/audio
 void InputDevice_KeyPress( object sender, InputDevice.KeyPressArgs e )
 {
     Log.Message("Key press : {0}", e.KeyChar );
 }
예제 #5
0
파일: InputDemo.cs 프로젝트: temik911/audio
 void InputDevice_KeyUp( object sender, InputDevice.KeyEventArgs e )
 {
     Log.Message("...key up event : {0}", e.Key );
 }
예제 #6
0
파일: InputDemo.cs 프로젝트: temik911/audio
 void InputDevice_FormKeyUp( object sender, InputDevice.KeyEventArgs e )
 {
     Log.Message("Form key up : {0}", e.Key );
 }
예제 #7
0
파일: InputDemo.cs 프로젝트: temik911/audio
        void InputDevice_KeyDown( object sender, InputDevice.KeyEventArgs e )
        {
            Log.Message("...key down event : {0}", e.Key );

            if (e.Key == Keys.F1) {
                DevCon.Show( this );
            }

            if (e.Key == Keys.F2) {
                Parameters.ToggleVSync();
            }

            if (e.Key == Keys.F5) {
                Reload();
            }

            if (e.Key == Keys.F12) {
                GraphicsDevice.Screenshot();
            }

            if (e.Key == Keys.Escape) {
                Exit();
            }
        }
예제 #8
0
 void InputDevice_KeyDown(object sender, InputDevice.KeyEventArgs e)
 {
     if (e.Key == Keys.Left)
     {
         if (k > 1) k--;
         thirstStep = false;
         gameCollection = (EntityCollection)stepList.Find(x => x.stepNumb == k).collection.Copy(null);
         queue.clear();
         queue.GameCollection = gameCollection;
         Game.GetService<GameFieldService>().GameField.coolNoise();
         pause = true;
     }
     if (e.Key == Keys.Right)
     {
         if (k < stepList.Count)
         {
             if (!thirstStep) k++;
             thirstStep = false;
             gameCollection = (EntityCollection)stepList.Find(x => x.stepNumb == k).collection.Copy(null);
             queue.clear();
             queue.GameCollection = gameCollection;
             Game.GetService<GameFieldService>().GameField.coolNoise();
             pause = true;
         }
     }
     if (e.Key == Keys.Space)
     {
         pause = false;
         thirstStep = true;
     }
 }
예제 #9
0
        void InputDeviceOnKeyDown(object sender, InputDevice.KeyEventArgs keyEventArgs)
        {
            float multiplayer = 1.0f;
            if (InputDevice.IsKeyDown(Keys.LeftShift)) multiplayer = 10.0f;

            if (keyEventArgs.Key == Keys.T) minDistance -= 1.0f * multiplayer;
            if (keyEventArgs.Key == Keys.Y) minDistance += 1.0f * multiplayer;

            if (keyEventArgs.Key == Keys.G) maxDistance -= 1.0f * multiplayer;
            if (keyEventArgs.Key == Keys.H) maxDistance += 1.0f * multiplayer;

            if (keyEventArgs.Key == Keys.B) textureScale -= 1.0f * multiplayer;
            if (keyEventArgs.Key == Keys.N) textureScale += 1.0f * multiplayer;

            if (keyEventArgs.Key == Keys.Q) wireframe = !wireframe;
        }
예제 #10
0
 void InputDevice_MouseScroll( object sender, InputDevice.MouseScrollEventArgs e )
 {
     var hovered = GetHoveredFrame();
     if ( hovered!=null ) {
         hovered.OnMouseWheel( e.WheelDelta );
     }
 }
예제 #11
0
 void InputDevice_KeyDown(object sender, InputDevice.KeyEventArgs e)
 {
     if (e.Key == Keys.S)
         isNoiseMap = !isNoiseMap;
 }
예제 #12
0
		void InputDevice_KeyDown ( object sender, InputDevice.KeyEventArgs e )
		{
			if (e.Key == Keys.F1) {
				//DevCon.Show( this );
			}

			if (e.Key == Keys.F2) {
				Parameters.ToggleVSync();
			}

			if (e.Key == Keys.F5) {
				Reload();
			}

			if (e.Key == Keys.F12) {
				GraphicsDevice.Screenshot();
			}

			if (e.Key == Keys.Escape) {
				Exit();
			}
		}