views:

48

answers:

1

Hi

I'm currently developing a cross-plataform virtual keyboard. In linux i was able to do whatever i want, but in Windows i'm having problems to prevent the widget to obtain the keyboard focus.

In linux, using the window flag

Qt::X11BypassWindowManagerHint

the widget never gets the keyboard input, but of course, that flag does not work on Windows

Is there something equivalent to that flag or some method i can use instead?

any ideas would be appreciated

thanks in advance

+1  A: 

I would try to ignore the event. I believe you need to ignore FocusIn on the main application window - not sure about the actual event, you might need to prototype it. You can do ignore events by either installing an event filter or manually re-implementing one of the event methods (possibly event itself). I don't know which is the preferred way though but I'd attempt the event filter first for this task: http://doc.trolltech.com/4.6/qobject.html#eventFilter

I've never tried to capture the keyboard focus event, but I have been able to successfully ignore escape keys in a QDialog to prevent users from accidentally closing the window. I believe it should be possible.

laura