csripriya1
Programmer
Hi all,
I have a question not directly related to C++. I am writing a code in openGL using GLUT library. When I use the keyboard function,glutKeyboardFunc(keyboard) Keys like righ,left,up and down arrow keys don't provide input to this function. This is the function I used for this key board function.
void keyboard(unsigned char c, int x, int y)
{
cout<<"Keyborad int"<< int(c)<<endl;
if((int)c == GLUT_KEY_RIGHT)
g_fHumanX += 4;
else if((int)c == GLUT_KEY_LEFT)
g_fHumanX -= 4;
if (c == 27)
exit(0);
}
When I use any toher keys in the key board, it gives the corresponding integer values.But it does not give the integer values for the arrow keys.
When I use these keys in other application like word, these keys behave normally. I am surprised. Can anyone help me.
Thanks for your time and help
I have a question not directly related to C++. I am writing a code in openGL using GLUT library. When I use the keyboard function,glutKeyboardFunc(keyboard) Keys like righ,left,up and down arrow keys don't provide input to this function. This is the function I used for this key board function.
void keyboard(unsigned char c, int x, int y)
{
cout<<"Keyborad int"<< int(c)<<endl;
if((int)c == GLUT_KEY_RIGHT)
g_fHumanX += 4;
else if((int)c == GLUT_KEY_LEFT)
g_fHumanX -= 4;
if (c == 27)
exit(0);
}
When I use any toher keys in the key board, it gives the corresponding integer values.But it does not give the integer values for the arrow keys.
When I use these keys in other application like word, these keys behave normally. I am surprised. Can anyone help me.
Thanks for your time and help