public GetKey(UIWin.KeyField key, bool openedByKey) { // initialize the form InitializeComponent(); // set up to read raw keystrokes kbhook = new GlobalKeyboardHook(); kbhook.KeyboardPressed += OnKeyPressed; // eat the first event if opened by a keystroke eatEvent = openedByKey; // set up to receive joystick button presses JoystickDev.JoystickButtonChanged += OnJoystickButtonDown; }
private void GetKey_FormClosed(object sender, FormClosedEventArgs e) { kbhook.Dispose(); kbhook = null; base.Close(); }