0

I made a program which moves an QGraphicsPixmapItem with QKeyPressEvent(I am using ASDW to move the item) and my problem is when I push the button without releasing my item does not move smoothly. Just like writing AAAAAAAAAAAAAAA without releasing the button. it moves a bit first then waits for a little longer and then continues. Do any one of you guys know how to fix this?

tshepang
  • 12,111
  • 21
  • 91
  • 136
bcdurak
  • 1
  • 1

1 Answers1

0

What you're seeing is the repeat delay. If you type in a document and hold down a key, you'll see that there is a small delay before the repeated character is displayed. There will be a value that you can configure in the operating system to either increase or decrease the delay, but this is not what your program should do.

Instead, install an event filter for handling the keys. You can read about how to do that here.

TheDarkKnight
  • 27,181
  • 6
  • 55
  • 85