Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- bool isKeyPressed( int key )
- {
- return ( GetAsyncKeyState( key ) & 0x8000 ) != 0;
- }
- int main()
- {
- while ( true )
- {
- bool control = ( isKeyPressed( VK_LCONTROL ) || isKeyPressed( VK_RCONTROL ) );
- bool alt = ( isKeyPressed( VK_LMENU ) || isKeyPressed( VK_RMENU ) );
- bool q = isKeyPressed( 'Q' );
- //std::cout << control << ' ' << alt << ' ' << q << std::endl;
- if ( control and alt and q )
- {
- std::cout << "Pressed!" << std::endl;
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement