Results 1 to 2 of 2

Thread: Keyboard Hit

  1. #1
    Join Date
    May 2007
    Posts
    4
    Qt products
    Qt3
    Platforms
    Unix/X11

    Post Keyboard Hit

    while(1)
    {
    printf("Qt");

    }


    how to quit this loop using keyboardhit...

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Keyboard Hit

    This code is not good.
    But if you must use a while loop, you will have to add processEvets() in it, otherwise the GUI thread will not be able to process events.
    About catching keyboard events read here:
    http://doc.trolltech.com/3.3/qkeyevent.html
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Virtual Keyboard on Qtopia 4.2.1
    By shapirlex in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 11th April 2007, 15:51
  2. Keyboard auto repeat
    By akiross in forum Qt Programming
    Replies: 7
    Last Post: 4th March 2007, 16:05
  3. Grab keyboard events in Windows
    By durbrak in forum Qt Programming
    Replies: 1
    Last Post: 4th February 2007, 19:56
  4. Replies: 2
    Last Post: 24th July 2006, 18:36
  5. Keyboard Handling
    By ToddAtWSU in forum Qt Programming
    Replies: 4
    Last Post: 5th July 2006, 13:25

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.