V
V
vlarkanov2019-04-20 13:30:03
linux
vlarkanov, 2019-04-20 13:30:03

C++ under Linux: how to handle keyboard keystrokes?

Actually, subject. It is necessary to read the clicks on the keyboard arrows, and when the button is pressed and released, perform some actions (in my case, change the x, y coordinates). Compiler gcc, purely console application.
Something like this:

code = считать_код_клавиши();
    switch ( code )
    {
      case 75: x--; break;
      case 77: x++; break;
      case 72: y--; break;
      case 80: y++; break;
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vanyamba-electronics, 2019-04-20
@vlarkanov

NCURSES. Interfacing with the key board

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question