public SpecialKeyState CheckModifiers() { SpecialKeyState state = new SpecialKeyState(); if ((InterceptKeys.GetKeyState(VK_SHIFT) & 0x8000) != 0) { //SHIFT is pressed state.ShiftPressed = true; } if ((InterceptKeys.GetKeyState(VK_CONTROL) & 0x8000) != 0) { //CONTROL is pressed state.CtrlPressed = true; } if ((InterceptKeys.GetKeyState(VK_ALT) & 0x8000) != 0) { //ALT is pressed state.AltPressed = true; } if ((InterceptKeys.GetKeyState(VK_WIN) & 0x8000) != 0) { //ALT is pressed state.WinPressed = true; } return state; }
private bool KListener_hookedKeyboardCallback(KeyEvent keyevent, int vkcode, SpecialKeyState state) { if (GlobalKeyboardEvent != null) { return GlobalKeyboardEvent((int)keyevent, vkcode, state); } return true; }