Results 1 to 2 of 2

Thread: QML manually emit key press signal

  1. #1
    Join Date
    Apr 2011
    Posts
    9
    Thanks
    2
    Thanked 7 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QML manually emit key press signal

    Hello,

    I'm working on a QML game where the user can control a spaceship my moving it left/right with the arrow keys and firing at the enemy with the space bar.

    everything works, but i found the fact that if the user has the right/left key pressed and then hits space, the ship fires and then stops moving and the user has to release the arrow button and press it again to continue moving.

    Is it possible to manually emit the "pressed" signal with the right/left key after releasing the space bar to fix this?

    Thanks.

  2. #2
    Join Date
    Oct 2010
    Location
    India
    Posts
    12
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: QML manually emit key press signal

    Try to implement the Animations with ParallelAnimation and use the property running to start and stop the animation. Hope it will help you.

Similar Threads

  1. Replies: 2
    Last Post: 3rd May 2011, 20:22
  2. Replies: 2
    Last Post: 1st January 2011, 00:16
  3. How to emit mouse press event in QPushButton
    By dpatel in forum Qt Programming
    Replies: 1
    Last Post: 30th December 2010, 13:00
  4. Manually send signal to slot
    By donmorr in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2006, 15:03
  5. emit a signal
    By Morea in forum Qt Programming
    Replies: 2
    Last Post: 27th February 2006, 11:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.