/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } if (InputEngine.IsKeyPressed(Keys.Right)) { if (current.Next != null) { current = current.Next; } } if (InputEngine.IsKeyPressed(Keys.Left)) { if (current.Previous != null) { current = current.Previous; } } // TODO: Add your update logic here base.Update(gameTime); }
public void Update(GameTime gameTime) { SpritePosition = InputEngine.CurrentMouseState.Position.ToVector2(); Bounds = new Rectangle((int)SpritePosition.X, (int)SpritePosition.Y, TextureManager.AllTextures[SpriteTextureKey].Width, TextureManager.AllTextures[SpriteTextureKey].Height); if (InputEngine.IsMouseLeftHeld() && HoldingACoin == false) { var q = Helper.AllCoins.FirstOrDefault(c => c.Bounds.Intersects(Bounds)); if (q != null && HoldingACoin == false) { q.Selected = true; HoldingACoin = true; } } else if (!InputEngine.IsMouseLeftHeld()) { HoldingACoin = false; var q = Helper.AllCoins.FirstOrDefault(c => c.Selected == true); if (q != null) { q.Selected = false; } } }
public override void Update(GameTime gametime) { if (InputEngine.IsKeyHeld(Keys.X)) { AngleOfRotation += RotationSpeed; } if (InputEngine.IsKeyHeld(Keys.Z)) { AngleOfRotation -= RotationSpeed; } if (InputEngine.IsKeyHeld(Keys.Up)) { PixelPosition += new Vector2( (float)Math.Sin(AngleOfRotation), -(float)Math.Cos(AngleOfRotation)) * 5; } if (InputEngine.IsKeyHeld(Keys.Down)) { PixelPosition -= new Vector2( (float)Math.Sin(AngleOfRotation), -(float)Math.Cos(AngleOfRotation)) * 5; } base.Update(gametime); }
public override void onButtonClick(InputEngine.MouseArgs e) { if (IsIn(e.curState.X, e.curState.Y)) { e.Handled = true; } }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } if (InputEngine.IsKeyPressed(Keys.Down)) { if (current.Next != null) { current.Value.InFocus = false; current = current.Next; current.Value.InFocus = true; } // add rap around } if (InputEngine.IsKeyPressed(Keys.Up)) { if (current.Previous != null) { current.Value.InFocus = false; current = current.Previous; current.Value.InFocus = true; } } // add rap around // add a check to check and see if one of the menu Items is selected. // TODO: Add your update logic here base.Update(gameTime); }
public void Update(GameTime gameTime, Viewport v) { // if(gameTime.TotalGameTime.Seconds % 1 == 0) // { // Vector2 newPosition = Vector2.Clamp(Position + new Vector2(rnd.Next(-10, 10), rnd.Next(-10, 10)), new Vector2(rnd.Next(-10, 10), rnd.Next(-10, 10)), new Vector2(v.X-Image.Width, v.Y-Image.Height)); //// Vector2 newPosition = Vector2.SmoothStep(Position, new Vector2(rnd.Next(-10, 10), rnd.Next(-10, 10)), 0.1f); // //Vector2 newPosition = new Vector2(rnd.Next(-10, 10), rnd.Next(-10, 10)); // Position += newPosition; // BoundingRect = new Rectangle((int)Position.X, (int)Position.Y, Image.Width, Image.Height); // } if (InputEngine.IsMouseLeftClick() && BoundingRect.Contains(InputEngine.MousePosition)) { IsClicked = true; } //if (gameTime.TotalGameTime.Seconds % 3 == 0) //{ Position = Vector2.Lerp(Position, Target, 0.1f); if (Vector2.DistanceSquared(Position, Target) <= 0.1f) { Position = Target; Target = new Vector2(rnd.Next(0, v.Width - Image.Width), rnd.Next(0, v.Height - Image.Height)); Console.WriteLine("Position : " + Position); Console.WriteLine("Target : " + Target); } BoundingRect = new Rectangle((int)Position.X, (int)Position.Y, Image.Width, Image.Height); //} }
public override void Update(GameTime gameTime) { keyboard.Update(gameTime); if (InputEngine.IsKeyPressed(Keys.Enter) && !firstText && !Done) { Name = Output; Output = string.Empty; firstText = true; keyboard.Output = string.Empty; InputEngine.ClearState(); } if (InputEngine.IsKeyPressed(Keys.Enter) && firstText && !Done) { Output = string.Empty; keyboard.Output = string.Empty; Done = true; Enabled = false; Visible = false; } if (InputEngine.IsKeyPressed(Keys.Back)) { if (Output.Length > 0) { Output = Output.Remove(Output.Length - 1); } } if (InputEngine.IsKeyPressed(Keys.Space)) { Output += " "; } base.Update(gameTime); }
public void newClick(object sender, InputEngine.MouseArgs e) { Sound.SoundPlayer.PlayButtonClick(); GUIEngine.s_componentSelector.ResetSelection(); create = true; delete = false; }
public void clrClick(object sender, InputEngine.MouseArgs e) { Sound.SoundPlayer.PlayButtonClick(); Logics.PlacableAreasManager.Clear(); delete = false; create = false; }
public override void Reset() { var a = InputEngine.GetCursorGameCoords(); W.IsConnected = InputEngine.curMouse.LeftButton == ButtonState.Pressed && isIn((int)a.X, (int)a.Y); base.Reset(); }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } if (InputEngine.IsKeyPressed(Keys.R)) { reset(); } if (GraphicsDevice.Viewport.Bounds.Contains(InputEngine.MousePosition)) { if (InputEngine.MousePosition != InputEngine.PreviousMouseState.Position.ToVector2()) { p.Position = InputEngine.MousePosition; } } // To update the position of the Bounding box of the player p.Update(); // Se if the collectables are collected by the player foreach (var c in collectables) { c.Update(p); } base.Update(gameTime); }
public GetGameInputComponent(Game g) : base(g) { g.Components.Add(this); IsMouseVisible = true; input = new InputEngine(g); keyboard = new SimpleKeyboard(new Vector2(10, 10)); }
public override void backClick(object sender, InputEngine.MouseArgs e) { Sound.SoundPlayer.PlayButtonClick(); GUIEngine.ChangeScene(GUIEngine.s_levelsMenu, "GUILevels"); //Main.curState = "GUILevels"; //GUIEngine.curScene = GUIEngine.s_levelsMenu; }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } // Turn on chat mode if (InputEngine.IsKeyPressed(Keys.F1)) { // line represent the current line to be captured line = string.Empty; chatMode = !chatMode; } // if chatting then do not update game window if (chatMode) { if (InputEngine.IsKeyPressed(Keys.Enter)) { // replace connection id with name of logged in player chatproxy.Invoke("SendMess", new object[] { connection.ConnectionId, line }); line = string.Empty; //chatMessages.Add(line); } else { //if (InputEngine.PressedKeys.Length > 0) if (InputEngine.currentKey != Keys.None) { line += InputEngine.lookupKeys[InputEngine.currentKey]; } } } // update game window else { if (Keyboard.GetState().IsKeyDown(Keys.Space)) { proxy.Invoke("GetPoint"); } if (!(PlayerAuthentication.PlayerStatus == AUTHSTATUS.OK)) { Exitcount -= gameTime.ElapsedGameTime.TotalSeconds; if (Exitcount < 1) { Exit(); } } if (Keyboard.GetState().IsKeyDown(Keys.Enter)) { scores = PlayerAuthentication.getScores(5, "Battle Call"); if (scores != null) { _scoreboard = true; } } } // TODO: Add your update logic here base.Update(gameTime); }
public virtual void Update() { if (InputEngine.IsMouseLeftClick() && _bounds.Contains(InputEngine.MousePosition)) { _selected = true; } }
public override void Update(GameTime gameTime) { //if(Site != null) // Site.Update(gameTime); if (MyProjectile != null && MyProjectile.ProjectileState == Projectile.PROJECTILE_STATE.STILL) { myProjectile.TilePosition = TilePosition; // fire the rocket and it looks for the target if (InputEngine.IsKeyHeld(Keys.Space) || InputEngine.IsMouseLeftClick() || InputEngine.CurrentPadState.Buttons.A == ButtonState.Pressed) { MyProjectile.fire(Site.TilePosition); } } //if (MyProjectile != null) // MyProjectile.Update(gameTime); // update the health bar object //if (Hbar != null) //{ // Hbar.position = PixelPosition + new Vector2(-10, -20); // Hbar.health = Health; //} base.Update(gameTime); }
public void Update() { if (InputEngine.IsMouseLeftClick() && Bound.Contains(InputEngine.MousePosition)) { Selected = true; } }
public void Update(GameTime gametime) { foreach (var key in keys) { var rect = new Rectangle((int)key.Position.X, (int)key.Position.Y, key.Width, key.Height); if (rect.Contains((int)InputEngine.MousePosition.X, (int)InputEngine.MousePosition.Y)) { key.IsMouseOver = true; if (InputEngine.IsMouseLeftClick()) { if (key.Text == "Space") { Output += " "; } else if (key.Text == "Delete") { if (Output.Length > 0) { Output = Output.Remove(Output.Length - 1); } } else { Output += key.Text; } } } else { key.IsMouseOver = false; } } }
public override void Update(GameTime gameTime) { if (InputEngine.IsKeyHeld(Keys.Left)) { move(new Vector2(-1, 0) * CameraSpeed, Game.GraphicsDevice.Viewport); } if (InputEngine.IsKeyHeld(Keys.Right)) { move(new Vector2(1, 0) * CameraSpeed, Game.GraphicsDevice.Viewport); } if (InputEngine.IsKeyHeld(Keys.Down)) { move(new Vector2(0, 1) * CameraSpeed, Game.GraphicsDevice.Viewport); } if (InputEngine.IsKeyHeld(Keys.Up)) { move(new Vector2(0, -1) * CameraSpeed, Game.GraphicsDevice.Viewport); } TilePlayer p = (TilePlayer)Game.Services.GetService(typeof(TilePlayer)); if (p != null) { follow(p.PixelPosition, Game.GraphicsDevice.Viewport); //Make sure the player stays in the bounds p.PixelPosition = Vector2.Clamp(p.PixelPosition, Vector2.Zero, new Vector2(_worldBound.X - p.BoundingRectangle.Width, _worldBound.Y - p.BoundingRectangle.Height)); } base.Update(gameTime); }
private void HandleSelection() { if (InputEngine.IsKeyPressed(ActivateKey)) { Slots[SlotPosition].isClicked = true; } }
public void backClick(object sender, InputEngine.MouseArgs e) { Sound.SoundPlayer.PlayButtonClick(); GUIEngine.ChangeScene(GUIEngine.s_mainMenu, "GUIMainMenu"); //Main.curState = "GUIMainMenu"; //GUIEngine.curScene = GUIEngine.s_mainMenu; }
private void UpdateSelectPosition() { Position = Vector2.Lerp(Position, new Vector2( Slots[SlotPosition].Position.X - SPACING, Slots[SlotPosition].Position.Y), CURSOR_SPEED); if (InputEngine.IsKeyPressed(Keys.S) || InputEngine.IsKeyPressed(Keys.Down) && SlotPosition <= (Slots.Count - 1)) { SceneManager.AudioResource["snd_cursor"].Play(); SlotPosition++; if (SlotPosition == (Slots.Count)) { SlotPosition = 0; } } else if (InputEngine.IsKeyPressed(Keys.W) || InputEngine.IsKeyPressed(Keys.Up) && SlotPosition >= 0) { SceneManager.AudioResource["snd_cursor"].Play(); if (SlotPosition == 0) { SlotPosition = Slots.Count; } SlotPosition--; } }
void invert_onClicked(object sender, InputEngine.MouseArgs e) { Swapper s = AssociatedComponent as Swapper; s.Swapped = !s.Swapped; if (Settings.GameState == Settings.GameStates.Stopped) s.OrigSwapped = !s.OrigSwapped; }
public override void Update() { float radius = (Material as DirectionalLightMaterial).Attenuation; Color color = (Material as DirectionalLightMaterial).LightColor; Vector3 pos = (Material as DirectionalLightMaterial).Position; if (InputEngine.IsKeyHeld(Keys.Add)) { (Material as DirectionalLightMaterial).Attenuation += 0.5f; } else if (InputEngine.IsKeyHeld(Keys.Subtract)) { (Material as DirectionalLightMaterial).Attenuation -= 0.5f; } if (InputEngine.IsKeyHeld(Keys.Left)) { (Material as DirectionalLightMaterial).Position -= new Vector3(1, 0, 0); } else if (InputEngine.IsKeyHeld(Keys.Right)) { (Material as DirectionalLightMaterial).Position += new Vector3(1, 0, 0); } base.Update(); }
public override void OnMouseDown(InputEngine.MouseArgs e) { base.OnMouseDown(e); x = e.curState.X; y = e.curState.Y; btn = e.button; }
public void update() { if (InputEngine.IsKeyPressed(Keys.Enter)) { SoundEffectInstance soundPlayer = null; AudioPlayer.AudioManager.Play(ref soundPlayer, text); } }
public override void onButtonUp(InputEngine.MouseArgs e) { if (e.button == 0 && isdnd) { isdnd = false; e.Handled = true; } }
public override void onButtonDown(InputEngine.MouseArgs e) { base.onButtonDown(e); e.Handled = true; if (!bok.IsIn(e.curState.X, e.curState.Y) && !breset.IsIn(e.curState.X, e.curState.Y) && !bcancel.IsIn(e.curState.X, e.curState.Y)) seq.AddRecord(); }
public override void OnMouseUp(InputEngine.MouseArgs e) { base.OnMouseUp(e); btn = -1; x = 0; y = 0; }
private void Awake() { InputEngine = InputEngine ?? FindObjectOfType <InputEngine>(); Debug.Assert(InputEngine != null); Debug.Assert(InputEngine.LinePrefab != null); Debug.Assert(PolylineMaterial != null); Debug.Assert(SplineMaterial != null); }
public override void onMouseMove(InputEngine.MouseMoveArgs e) { bool wasover = isMouseOver; base.onMouseMove(e); if (isMouseOver && !wasover) { Sound.SoundPlayer.MenuMouseOver(); } }
public override void OnMouseMove(InputEngine.MouseMoveArgs e) { base.OnMouseMove(e); if (btn != -1) { Resistance += (float)(e.dy)/10f; } }
public void Clear() { firstText = false; Name = string.Empty; output = string.Empty; input.KeysPressedInLastFrame.Clear(); InputEngine.ClearState(); Done = false; }
public void PlaySound() { if (InputEngine.IsMouseLeftClick() && bounds.Contains(InputEngine.CurrentMouseState.Position)) { //Console.WriteLine("Doing this"); AudioManager.Play(ref player, soundKey); } }
protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { LeaveGame(); Exit(); #region starting in menu and switching to game //sets mouse state mouseState = Mouse.GetState(); //switch for setting the scene switch (CurrentScreen) { case MENU: //What we want to happen in the MENU screen goes in here. //GO TO PLAYGAME SCREEN if (playGameButton.update(new Vector2(mouseState.X, mouseState.Y)) == true && mouseState != previousMouseState && mouseState.LeftButton == ButtonState.Pressed && !firstText && !Done) { Name = Output; Output = string.Empty; firstText = true; InputEngine.ClearState(); CurrentScreen = PLAYGAME; } if (InputEngine.IsKeyPressed(Keys.Enter) && firstText && !Done) { Output = string.Empty; Done = true; } if (InputEngine.IsKeyPressed(Keys.Back)) { if (Output.Length > 0) { Output = Output.Remove(Output.Length - 1); } } if (InputEngine.IsKeyPressed(Keys.Space)) { Output += " "; } break; case PLAYGAME: //What we want to happen when we play our GAME goes in here. startGame(); break; } } // TODO: Add your update logic here previousMouseState = mouseState; #endregion base.Update(gameTime); }
public override void onButtonDown(InputEngine.MouseArgs e) { if (IsIn(e.curState.X, e.curState.Y) && e.button == 0) { isdnd = true; ChangeScale(e.curState.X); e.Handled = true; } }
public void deleteClick(object sender, InputEngine.MouseArgs e) { Sound.SoundPlayer.PlayButtonClick(); if (saves.SelectedIndex == -1) return; mb = YesNoMessageBox.Show("Are you sure you want\r\nto delete the following file: \r\n" + saves.GetSelected() + "?"); mb.onButtonClicked += new YesNoMessageBox.ButtonClickedEventHandler(mb_onButtonClicked); GUIEngine.AddHUDScene(mb); }
public void Update() { if (InputEngine.IsKeyPressed(Keys.P)) { // The line below acts as a toggle, much quicker than an if else statement. Active = !Active; } if (!Active) { return; } if (InputEngine.IsKeyPressed(Keys.Down)) { if (current.Next != null) { current.Value.InFocus = false; current = current.Next; current.Value.InFocus = true; } else { current.Value.InFocus = false; current = MenuList.First; current.Value.InFocus = true; } // add rap around } if (InputEngine.IsKeyPressed(Keys.Up)) { if (current.Previous != null) { current.Value.InFocus = false; current = current.Previous; current.Value.InFocus = true; } else { current.Value.InFocus = false; current = MenuList.Last; current.Value.InFocus = true; } } // add a check to check and see if one of the menu Items is selected. if (InputEngine.IsKeyPressed(Keys.Enter)) { current.Value.Selected = true; } if (current.Value.Selected) { SelectedText = current.Value.text; current.Value.Selected = false; } }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here //worldRect = new Rectangle(new Point(0, 0), worldSize.ToPoint()); //followCamera = new FollowCamera(this, Vector2.Zero, worldSize); inputEngine = new InputEngine(this); LidgrenClient.StartServer(); base.Initialize(); }
public override void OnMouseWheel(InputEngine.MouseWheelMoveArgs e) { base.OnMouseWheel(e); if (e.delta != 0) { Resistance += (float)(e.delta) / 120f; } }
private void copy() { if (SelectionStart == -1 || SelectionLength == 0) { return; } String s = SelectedText; InputEngine.SetClipboardText(s); }
//if the spacebar is pressed //Use Engine.LoadScene to load the BowlingScene public override void HandleInput() { if (InputEngine.IsKeyPressed(Keys.Space))//load the level scene when pressed { Engine.LoadScene(new DartScene(Engine)); MediaPlayer.Play(Music);//plays the backing theme , bonus points if you recognise it } base.HandleInput(); }
public override void onKeyPressed(InputEngine.KeyboardArgs e) { if (e.key == Keys.Delete.GetHashCode() && bRemove.isEnabled) { bRemove_onClicked(null, null); e.Handled = true; return; } base.onKeyPressed(e); }
public override void Update() { if (warningFadeState < 100) { if (fbo == null || fbo.Width != Main.WindowWidth) { fbo = new RenderTarget2D(GraphicsEngine.Renderer.GraphicsDevice, Main.WindowWidth, Main.WindowHeight); } GraphicsEngine.Renderer.EnableFBO(fbo); GraphicsEngine.Renderer.BeginUnscaled(); #region ActualDraw GraphicsEngine.Renderer.Draw(title, new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight), Color.White); GraphicsEngine.Renderer.Draw(dots, new Rectangle( 439 * Main.WindowWidth / 1920, 872 * Main.WindowHeight / 1080, 1003 * Main.WindowWidth / 1920, 14 * Main.WindowHeight / 1080), Color.White); GraphicsEngine.Renderer.Draw(gradient, new Rectangle( gradStart, 872 * Main.WindowHeight / 1080, 480 * Main.WindowWidth / 1920, 14 * Main.WindowHeight / 1080), Color.White); #endregion GraphicsEngine.Renderer.End(); GraphicsEngine.Renderer.DisableFBO(); } if (warningFadeState != 0 && warningFadeState < 200) { warningFadeState += 4; } else if (warningFadeState == 200) { warningTimeout++; InputEngine.Update(); if (InputEngine.curMouse.LeftButton != ButtonState.Released || InputEngine.curMouse.RightButton != ButtonState.Released || InputEngine.curKeyboard.GetPressedKeys().Length != 0) { warningFadeState += 4; } if (warningTimeout >= 800) { warningFadeState += 4; } } else if (warningFadeState > 200) { warningFadeState += 4; if (warningFadeState >= 300) { Graphics.GUI.GUIEngine.ChangeScene(Graphics.GUI.GUIEngine.s_mainMenu, "GUIMain"); } } }
private bool InputShoot() { if (InputEngine.IsMouseLeftHeld() || InputEngine.IsButtonHeld(Buttons.RightTrigger)) { return(true); } else { return(false); } }
public virtual void onButtonClick(InputEngine.MouseArgs e) { lock (controls) { foreach (Control c in controls) { if (c.isVisible) c.onButtonClick(e); if (InputEngine.eventHandled) break; } } }
public bool EscapeScene() { if (InputEngine.IsKeyPressed(EscapeKey)) { return(true); } else { return(false); } }
public override void onButtonClick(InputEngine.MouseArgs e) { if (!IsIn(e.curState.X, e.curState.Y) && !GUIEngine.s_subComponentButtons.IsIn(e.curState.X, e.curState.Y)) { GUIEngine.RemoveHUDScene(this); GUIEngine.RemoveHUDScene(GUIEngine.s_subComponentButtons); GUIEngine.s_subComponentButtons.isVisible = false; e.Handled = true; } base.onButtonClick(e); }
public override void onButtonClick(InputEngine.MouseArgs e) { base.onButtonClick(e); if (tbCode.isVisible) { if (!tbCode.IsIn(e.curState.X, e.curState.Y)) { tbCode.isVisible = false; } e.Handled = true; } }
public void loadClick(object sender, InputEngine.MouseArgs e) { Sound.SoundPlayer.PlayButtonClick(); if (saves.SelectedIndex == -1) return; GUIEngine.ChangeScene(GUIEngine.s_loading, "GUILoading"); //GUIEngine.curScene = GUIEngine.s_loading; //Main.curState = "GUILoading"; System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(_load)); t.Start(); }
void close_onClicked(object sender, InputEngine.MouseArgs e) { close.StaySelected = false; close.isMouseOver = false; close.WasInitiallyDrawn = false; Close(); }
public override void onKeyUp(InputEngine.KeyboardArgs e) { base.onKeyUp(e); e.Handled = true; }
public override void onKeyPressed(InputEngine.KeyboardArgs e) { base.onKeyPressed(e); Close(); e.Handled = true; }
public override void onButtonUp(InputEngine.MouseArgs e) { base.onButtonUp(e); e.Handled = true; }
public override void onButtonClick(InputEngine.MouseArgs e) { base.onButtonClick(e); //Close(); e.Handled = true; }
public override void onMouseWheelMove(InputEngine.MouseWheelMoveArgs e) { if (IsIn(e.curState.X,e.curState.Y)) { e.Handled = true; } base.onMouseWheelMove(e); }
public override void onMouseMove(InputEngine.MouseMoveArgs e) { base.onMouseMove(e); e.Handled = true; }
public override void onButtonUp(InputEngine.MouseArgs e) { if (IsFading) { e.Handled = true; return; } base.onButtonUp(e); }
public override void onMouseWheelMove(InputEngine.MouseWheelMoveArgs e) { if (!e.Handled) { logoffset -= e.delta / 120 * 4; CheckLogRange(); updateLog(); } e.Handled = true; }
public override void onKeyPressed(InputEngine.KeyboardArgs e) { e.Handled = true; if (e.key == Keys.Enter.GetHashCode() && InputEngine.Control) { DoCommand(tbinput.Text); for (int i = InputHistory.Length - 1; i > 0; i--) { InputHistory[i] = InputHistory[i - 1]; } InputHistory[0] = tbinput.Text; tbinput.Text = ""; CurInputHistorySelected = -1; logoffset = OutputEngine.LOG_LENGTH; CheckLogRange(); updateLog(); return; } if (e.key == Keys.Up.GetHashCode()) { CurInputHistorySelected++; if (CurInputHistorySelected >= InputHistory.Length) CurInputHistorySelected = InputHistory.Length - 1; if (InputHistory[CurInputHistorySelected] == null) CurInputHistorySelected--; if (CurInputHistorySelected == -1) tbinput.Text = ""; else tbinput.Text = InputHistory[CurInputHistorySelected]; tbinput.Cursor = tbinput.Text.Length; return; } if (e.key == Keys.Down.GetHashCode()) { CurInputHistorySelected--; if (CurInputHistorySelected < -1) CurInputHistorySelected = -1; if (CurInputHistorySelected == -1) tbinput.Text = ""; else tbinput.Text = InputHistory[CurInputHistorySelected]; tbinput.Cursor = tbinput.Text.Length; return; } InputEngine.eventHandled = false; CurInputHistorySelected = -1; base.onKeyPressed(e); e.Handled = true; }