I am making a program that converts qwerty keyboard into a azerty keyboard. How it works is when you press q the program presses backspace then releases q then presses a. Where im running into trouble is when i try to make it so q replaces a and a replaces q. What happens is when i press q the program presses a and the when the program presses a it replaces it with q so it doesn't work. Can you tell me how to tell the difference between a physical keystroke and a keystroke made by a program. This is my code.
int main()
{
int a=0x41,b=0x42,c=0x43,d=0x44,e=0x45,f=0x46,g=0x47,h=0x48,i=0x49,j=0x4A,k=0x4b,l=0x4c,m=0x4d,n=0x4e,o=0x4f,p=0x50,q=0x51,r=0x52,s=0x53,t=0x54,u=0x55,v=0x56,w=0x57,x=0x58,y=0x59,z=0x5a;
while (1==1){
if (GetAsyncKeyState(q)!=0)//check if w is pressed