Results 1 to 3 of 3

Thread: Print screen key in Qt windows

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Print screen key in Qt windows

    Hi ,
    I am using Qt 4.5.0 in MSVisual Studio 2005.I need a scancode for all the keyboard keys and I used the following Qt events in my application to collect the scancodes for all the keys.
    code A:
    bool event(QEvent *event)// event handler
    {
    QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
    codevalue = keyEvent->nativeScanCode();
    qDebug()<<"The scancode is "<<codevalue<<endl; //to print the scancode to the console.
    }

    Code B:
    void keyPressEvent(QKeyEvent * keyEvent)
    {
    codevalue = keyEvent->nativeScanCode();
    qDebug()<<"scancode is "<<codevalue<<endl;
    }

    In windows,using these functions I got the scancodes for all the keys except PrintScreen key. Please help me how do I get the Scancode for PrintScreen key in Windows.

    Note:: In linux PrintScreen key has scancode integer value of 111.

    Thanks in advance,
    Hanumanth..
    Last edited by hanumanth; 9th April 2010 at 05:43. Reason: reformatted to look better

Similar Threads

  1. Creating a Screen Saver for Windows
    By spud in forum Qt Programming
    Replies: 1
    Last Post: 2nd November 2011, 15:58
  2. QT4 and Vista/Windows 7 High Screen DPI
    By ChrisW67 in forum Qt Programming
    Replies: 2
    Last Post: 9th April 2010, 07:43
  3. Replies: 1
    Last Post: 9th November 2009, 09:27
  4. Cancelling Long-running Print/Print Preview
    By ChrisW67 in forum Newbie
    Replies: 4
    Last Post: 16th June 2009, 23:05
  5. Print PDF under Windows
    By giusepped in forum Qt Programming
    Replies: 4
    Last Post: 9th January 2009, 00:35

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.