Advertisement
Guest User

11

a guest
Mar 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <conio.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. wchar_t klawisz1, klawisz2;
  9.  
  10. cout << "Wciskaj klawisze; koniec = ESC" << endl;
  11. do {
  12.  
  13. //cout << endl;
  14. klawisz1 = _getch(); //pobranie klawisza
  15. //cout << "kod klawisza = " << klawisz1;
  16. if ((klawisz1 == 0) || (klawisz1 == 224)) {
  17. klawisz2 = _getch(); //pobranie klawisza
  18. //cout << ", " << klawisz2;
  19. }
  20. //cout << endl;
  21. klawisz1 = toupper(klawisz1);
  22.  
  23. switch (klawisz1) { //kod wcisinietego klawisza w Unicode
  24. case 65:
  25. case 69:
  26. case 73:
  27. case 79:
  28. case 85:
  29. case 89:
  30. {cout << "" << static_cast <char>(klawisz1); } break;
  31. case 27: break; //ESC
  32. //case 0: { //klawisze specjalane
  33. //switch (klawisz2) {
  34. //case 59: cout << "F1" << endl; break; //F1
  35. //case 60: cout << "F2" << endl; break; //F2
  36. //} break; }
  37. //case 224: break; //klawisze specjalane
  38. default: cout <<"_"; break;
  39. }
  40. } while (klawisz1 != 27);
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement