Results 1 to 2 of 2

Thread: Qt/Mac - Stuck with user focus

  1. #1
    Join Date
    Jan 2009
    Qt products
    MacOS X Unix/X11

    Default Qt/Mac - Stuck with user focus

    Hello guys
    Im developing an application for Mac OS X Leopard on Qt - kinda onscreen keyboard.
    The thing is I need to make QMainWindow of the application not accepting keyboard focus (user focus) when user clicks on it choosing possible letters (keep it always inactivated). And then send keys to any other apps

    I have already tried both:

    in Qt setFocusPolicy(Qt::NoFocus) - the window stops getting focusEvents but still grabs keyboard focus
    in Carbon setting kHIWindowBitNoActivates and kWindowNoActivatesAttribute for this WindowRef

    Both variants didnt work.
    Are there any workarounds in Qt or any for Carbon?

    Afterwards when the window is off-focus I need to send the key to other application(system wide) which currently has user focus. I think CGEventCreateKeyboardEvent and then CGEventPost in Carbon would do the trick or are there any options in Qt?
    Im using Qt 4.4 which still utilizes Carbon

    Any help will be appreciated..


  2. #2
    Join Date
    Jan 2009
    Qt products
    MacOS X Unix/X11

    Default Re: Qt/Mac - Stuck with user focus

    Oop found a similar problem

    But there it is about X11. It can be done like
    Qt Code:
    1. Atom atom = XInternAtom(display, "WM_TAKE_FOCUS", true);
    2. XFree(atom);
    To copy to clipboard, switch view to plain text mode 

    How to make the same thing in mac?

Similar Threads

  1. Logging Qt User Actions
    By Frank J. Lhota in forum Qt Programming
    Replies: 14
    Last Post: 30th May 2014, 22:36

Tags for this Thread


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.