private void frmNewKey_KeyDown(object sender, KeyEventArgs e) { int vk = e.KeyValue; if (Macro.IsShift(vk)) //ah man idk if hookcallback can sometimes return the actual shiftkey vk { vk = Macro.IsKeyPushedDown(Keys.LShiftKey) ? (int)Keys.LShiftKey : (int)Keys.RShiftKey; } else if (Macro.IsCtrl(vk)) { vk = Macro.IsKeyPushedDown(Keys.LControlKey) ? (int)Keys.LControlKey : (int)Keys.RControlKey; } else if (Macro.IsAlt(vk)) { vk = Macro.IsKeyPushedDown(Keys.LMenu) ? (int)Keys.LMenu : (int)Keys.RMenu; } setKeyState(e.Control, e.Alt, e.Shift, vk); e.SuppressKeyPress = true; //txtKeyInt.Text = e.KeyValue.ToString(); }
bool IsKeyDepressed(int vk) { return(Macro.IsKeyPushedDown((Keys)vk)); //return _keyDepressedSet.Contains(vk); }