/// <summary> /// Registers KeyUp Event for keys passed as list in the first argument to execute /// delegate passed in the second argument. /// </summary> /// <param name="keyList">List of keys names.</param> /// <param name="keyPressedDelegate">Delegate to be executed on KeyUp event.</param> public void RegisterKeys(string[] keyList, KeyPressedDelegate keyPressedDelegate) { _keyPressedDelegate += keyPressedDelegate; Forms.NativeParent.KeyUp += KeyEvent; foreach (var key in keyList) { Forms.NativeParent.KeyGrab(key, true); } }
/// <summary> /// Registers KeyUp Event for keys passed as list in the first argument to execute /// delegate passed in the second argument. /// </summary> /// <param name="keyList">List of keys names.</param> /// <param name="keyPressedDelegate">Delegate to be executed on KeyUp event.</param> public void RegisterKeys(string[] keyList, KeyPressedDelegate keyPressedDelegate) { _keyPressedDelegate += keyPressedDelegate; Forms.Context.MainWindow.KeyUp += KeyEvent; foreach (var key in keyList) { Forms.Context.MainWindow.KeyGrab(key, true); } }
public DrawForm() { //Cursor.Hide(); InitializeComponent(); _SetData = new SettingsData(); this.Sets.Data = _SetData; this.Sets.Update += new Settings.SettingsUpdate(SetsUpdate); this.mainMenu1.Choice += new MainMenu.MenuItemChosen(MenuEvent); this.LevelStart += new LevelChosen(OnLevelStart); this.LevelChooser.Choice += new Draw.LevelChoice.LevelChosen(LevelChoice); this.GLD = new GLControl(); this.GLD.BackColor = System.Drawing.Color.Black; this.GLD.Dock = System.Windows.Forms.DockStyle.Fill; this.GLD.Location = new System.Drawing.Point(0, 0); this.GLD.Name = "GLD"; this.GLD.Size = new System.Drawing.Size(800, 600); this.GLD.TabIndex = 0; this.GLD.VSync = false; this.GLD.Load += new System.EventHandler(this.GLDLoad); this.GLD.Paint += new System.Windows.Forms.PaintEventHandler(this.GLDPaint); this.GLD.MouseDown += new System.Windows.Forms.MouseEventHandler(this.GLD_MouseDown); this.GLD.MouseMove += new System.Windows.Forms.MouseEventHandler(this.GLD_MouseMove); this.GLD.MouseUp += new System.Windows.Forms.MouseEventHandler(this.GLD_MouseUp); this.GLD.Resize += new System.EventHandler(this.GLD_Resize); this.GLD.Visible = false; this.Controls.Add(GLD); this.Data = new GameData(); this.ArtData = new ArtData(); this._Controls = new PerfectPidgeon.Draw.Controls(); this._Renderer = new Renderer(GLD, Data, ArtData, this._Controls, this._SetData); MouseMoved = new MouseEventHandler(OnMouseMoved); MouseUpP = new MouseEventHandler(OnMouseUp); MouseDownP = new MouseEventHandler(OnMouseDown); KeyPressed = new KeyPressedDelegate(OnKeyPress); LeftRotate = new AxisRotate(OnLeftRotate); this._Joystick = new Joystick(0); this._Joystick.LeftAxisChange += new AxisEvent(JoystickAxisLeft); this._Joystick.RightAxisChange += new AxisEvent(JoystickAxisRight); this._Joystick.JoystickButtonPress += new ButtonPress(JoystickButtonPressed); //Listen = new PidgeonLeapListener(); //Control = new Controller(); //Control.AddListener(Listen); UpdateLeap = new System.Timers.Timer(); UpdateLeap.Enabled = true; UpdateLeap.Elapsed += new System.Timers.ElapsedEventHandler(Leap_Tick); UpdateLeap.Interval = 30; UpdateLeap.Start(); }
public void KeyPressWait(KeyPressedDelegate callback) { }
/// <summary> /// Registers KeyUp Event for keys passed as list in the first argument to execute /// delegate passed in the second argument. /// </summary> /// <param name="keyList">List of keys names.</param> /// <param name="keyPressedDelegate">Delegate to be executed on KeyUp event.</param> public void RegisterKeys(string[] keyList, KeyPressedDelegate keyPressedDelegate) { _keyPressedDelegate += keyPressedDelegate; }