예제 #1
0
        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;
        }
예제 #2
0
 private void GetKey_FormClosed(object sender, FormClosedEventArgs e)
 {
     kbhook.Dispose();
     kbhook = null;
     base.Close();
 }