I want to handling arrow keys. but when I print out the input value for waitKey() function, It's 0. I don't know why. I try to change from "int" to "char" , but It doesn't work. How can I solve this problem.
int pos = 100;
imshow("image", image);
onChange(pos, (void *)&image);
createTrackbar("threshold", "image", &pos, 255, onChange, (void*)&image);
while (1) {
int Key = waitKey();
cout << Key << endl;
if (Key == 27) break;
if (Key == 2490368) {
pos--;
onChange(pos, (void *)&image);
}
if(Key == 2621440){
pos++;
onChange(pos, (void *)&image);
}
if (pos < 0 || pos > 255) pos = 0;
}