[Qt-interest] [Qt/Mac] Stuck with user focus

Sergey Uspensky serguspen at gmail.com
Fri Jan 23 20:51:40 CET 2009


Hello guys!
Im developing an application for Mac OS Leopard on Qt - kinda onscreen
keyboard.
The thing is I need to make MainWindow of the application not accepting
keyboard focus (user focus) when user clicks on it choosing possible letters
(keep it always inactivated).

I have already tried both:

in Qt 4.4 (it uses Carbon as far as i know) setFocusPolicy(Qt::NoFocus) -
the window stops getting focusEvents but still grabs keyboard focus
and
in Carbon setting kHIWindowBitNoActivates and kWindowNoActivatesAttribute
for this WindowRef

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

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 would do the trick?

Any help will be appreciated.

TIA,
Sergey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090123/1cf85fbb/attachment.html 


More information about the Qt-interest-old mailing list