public frmGetKey(bool singleKeyMode) { InitializeComponent(); _singleKeyMode = singleKeyMode; if (_singleKeyMode) { tableLayoutPanel1.RowStyles[1].SizeType = SizeType.Absolute; tableLayoutPanel1.RowStyles[1].Height = 0; } if (_singleKeyMode) { lblCurrentKeys.Height = 1; lblCurrentKeys.Visible = false; } ShortcutKey = new KeyCombination(); InputApi.UpdateInputDevices(); InputApi.ResetKeyState(); //Prevent other keybindings from interfering/activating InputApi.DisableAllKeys(true); }
protected override void OnFormClosing(FormClosingEventArgs e) { InputApi.DisableAllKeys(false); base.OnFormClosing(e); }