How to use slots to record keystrokes on the keyboard?

  • 0
    There is a picture, you need to move it by pressing a key (any), do you need slots, if so, how to implement all this with their help.
    C++ Anonymous, Apr 4, 2019

  • 2 Answers
  • 0
    You can't use slots. Use events. In general, it's a repeat.


    And the picture in the question in general has nothing to do with the matter. The task is to get the fact of pressing a key.
    Anonymous

  • 0
    Roughly speaking, keyPressEvent (if I remember its name correctly) will be the usual method in your class, where the image is managed. You press a key, this function is called and the code that you write there is executed. Strange, I thought there were many examples on the Internet on this topic.
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!