hello,i am using GetAsyncKeyState() function for a keylogger,but my problem is: how do i test if 2 keys are pressed simultanion. For example: when i press SHIFT and letter 'a' it should print 'A'. Can anyone help me ? thanx

if ( GetAsyncKeyState ( VK_SHIFT ) && GetAsyncKeyState ( 0x41 ) ) {
  // SHIFT+A combination pressed
}

thanks,it works,but only if i press an the same time,could there be a way to press SHIFT first and after 'a' ? :)

>could there be a way to press SHIFT first and after 'a' ?
Yes, there could. You also have the tools necessary to figure it out. Give it a shot.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.