Hello all,
after a long time of debugging (because of my little experience with windows programing and debugging), i found the problem that breaks the keyboard input of my favorite game "You Don't Know Jack" (demos of newer versions downloadable at http://www.take2.de/downloads/demos.php).
The problem is that the game is waiting for keyboard input by checking for the messages WM_KEYDOWN, WM_CHAR and WM_KEYUP at least for the keys 1-0 and a-z. But wine generates the messages WM_SYSKEYDOWN, WM_SYSCHAR? and WM_SYSKEYUP.
The problem is in the file "windows/message.c" in the methode "process_raw_keyboard_message" in the line 383:
if (msg->message < WM_SYSKEYDOWN) msg->message += WM_SYSKEYDOWN - WM_KEYDOWN;
For some reason i do not understand the message becomes changed. If i remove this line the game recognize the keyboard input and is playable (somehow).
An other option(untested) for the game is to change the line to something like this:
if (msg->message < WM_KEYDOWN) msg->message += WM_SYSKEYDOWN - WM_KEYDOWN;
Does anyone know why the message becomes changed? Or does anyone know a better fix for the problem? Is there a program the need the line as it is?
Tschüß Stefan
PS: I am not subscriped to this mailing list, but i'm reading the newsgroup wine.devel. So it will take some time to see my answers to your questions in the mailing list
On Sun, 26 Aug 2001, Stefan Leichter wrote:
Does anyone know why the message becomes changed?
If I remember right, a keyboard message must be changed to a syskey message when one of these conditions are true:
- the ALT key is pressed - a menu is being navigated (the system menu in particular) - the active/focused window is minimized (an icon)
May be others, but I don't think so. Which do you think applies?
As per the Platform SDK:
"The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key or holds down the alt key and then presses another key. It also occurs when now windows has the keyboard focus; in this case, the WM_SYSKEYDOWN message is send to the active window"
As far as i can see the function is ok, maybe GetFocus is bugged?
static BOOL process_raw_keyboard_message( MSG *msg, ULONG_PTR extra_info ) { if (!(msg->hwnd = GetFocus())) { /* Send the message to the active window instead, */ /* translating messages to their WM_SYS equivalent */ msg->hwnd = GetActiveWindow(); if (msg->message < WM_SYSKEYDOWN) msg->message += WM_SYSKEYDOWN - WM_KEYDOWN; } ...
Ove Kaaven wrote:
On Sun, 26 Aug 2001, Stefan Leichter wrote:
Does anyone know why the message becomes changed?
If I remember right, a keyboard message must be changed to a syskey message when one of these conditions are true:
- the ALT key is pressed
- a menu is being navigated (the system menu in particular)
- the active/focused window is minimized (an icon)
May be others, but I don't think so. Which do you think applies?
The first and the second one are not the case. I'm not sure about the third one.
The program is running in fullscreen mode but only if i use the --desktop option. In --managed mode and without mode specified there is no screen output. The program does not show anything like a screen or window (something that has a title bar or a border).
How can i check which of the last two cases wine thing it is true?
Bye Stefan