Duplication key up arrow (code 72 -32) and letter (-32), Eng. H (72).

Hello experts. I have difficulty has arisen with the by duplication key up arrow (code 72 -32) and letter (-32), Eng. H (72).

I am Trying through conditional structure: if and else , separate pressing the up arrow away from the letters.
Almost everything works except the letters (-32) and English. H (72). they give not it action.

Here is my code I have come to a standstill . Please help. Sory my English.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include <conio.h>
#include <locale.h>

using namespace std;

int main()
{
setlocale(LC_ALL," ");	
	int ch;
	char key;
	while(1)
	{
	key = _getch();
	ch = static_cast<int>(key);
	cout << ch << endl;
	
	if (!key  || (  key == 72 && key != -32
				||  key == 80 && key != -32
				||  key == 75 && key != -32
				||  key == 77 && key != -32)
				
				)
	{
		cout << "    Keys" << endl ;
	}
	else if (      key != -32 && key != 72  
				|| key != -32 && key != 75 
				|| key != -32 && key != 77 
				|| key != -32 && key != 80
				|| key != -32 && key !=72 
				|| key != -32 && key ==72
				 )
	{
		cout << "    letters" << endl ;
	}
	
	
	
	}
}
Topic archived. No new replies allowed.