wine rejecting keyboard input when window not focused

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
CShadowRun
Level 1
Level 1
Posts: 6
Joined: Fri Aug 29, 2008 9:06 am

wine rejecting keyboard input when window not focused

Post by CShadowRun »

I'm wondering if theres a way to allow keyboard input while the window is not focused. I made a program which broadcasts keystrokes between multiple windows (see the source here, http://www.nomorepasting.com/getpaste.php?pasteid=19683 ) This program works fine in everything, except wine. It works fine in wine too, but only when the window is focused.

This makes me think that wine is rejecting the keyboard input, purely because the window isn't focused. :(

If anyone has any ideas it'd be appriciated, however don't expect me to dive into the wine source code, i don't know anything apart from basic python, and most of the above code is copied from pykey.

Thanks in advance for any help.
Vincent Povirk

wine rejecting keyboard input when window not focused

Post by Vincent Povirk »

You probably need to send the keystrokes from within Wine.

Wine's keyboard input code has the interesting property that it does
not care which of its windows recieves keyboard events. This is
because Windows' keyboard input model is drastically different from
that of X. So Wine only uses X to get a stream of keystrokes from the
user, which it then processes and dispatches like Windows does. Since
this process throws away the destination of keyboard events, Wine
actually uses the input focus to decide where keystrokes are supposed
to go. If none of its windows are focused, keyboard input can't go
anywhere.

Vincent Povirk



On Fri, Aug 29, 2008 at 9:18 AM, CShadowRun <[email protected]> wrote:
I'm wondering if theres a way to disable it, I made a program which broadcasts keystrokes between multiple windows (see the source here, http://www.nomorepasting.com/getpaste.php?pasteid=19683 ) This program works fine in everything, except wine. It works fine in wine too, but only when the window is focused.

This makes me think that wine is rejecting the keyboard input, purely because the window isn't focused. :(

If anyone has any ideas it'd be appriciated, however don't expect me to dive into the wine source code, i don't know anything apart from basic python, and most of the above code is copied from pykey.

Thanks in advance for any help.




CShadowRun
Level 1
Level 1
Posts: 6
Joined: Fri Aug 29, 2008 9:06 am

Post by CShadowRun »

Well i tested with autoit, and yes i can controlsend text with it. But i can't hook hotkeys. I hear this isn't available in wine yet. Any other ideas?
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: wine rejecting keyboard input when window not focused

Post by vitamin »

CShadowRun wrote:I'm wondering if theres a way to allow keyboard input while the window is not focused.
Not from X. You can do that only within Wine itself.
CShadowRun wrote:Well i tested with autoit, and yes i can controlsend text with it. But i can't hook hotkeys. I hear this isn't available in wine yet. Any other ideas?
Autoit is one example of windows program that do what you want.

Hotkeys are not implemented in Wine.
CShadowRun
Level 1
Level 1
Posts: 6
Joined: Fri Aug 29, 2008 9:06 am

Post by CShadowRun »

that keyboard implimentation is a little broken then, I assume by what your saying such things as MPX (The multi pointer X server) will not work with wine very well. Someone should probably fix this issue :)
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

CShadowRun wrote:that keyboard implimentation is a little broken then, I assume by what your saying such things as MPX (The multi pointer X server) will not work with wine very well. Someone should probably fix this issue :)
Patches are welcome.

Also you can tell m$ to re-design everything the right way.
CShadowRun
Level 1
Level 1
Posts: 6
Joined: Fri Aug 29, 2008 9:06 am

Post by CShadowRun »

Would if i could, but that's way beyond me. Either need to get global hotkeys fixed, or keyboard input fixed othewrise this is impossible :(
Locked