Blender Git Commit Log

Git Commits -> Revision 0b03268

Revision 0b03268 by Dalai Felinto (master)
May 7, 2011, 22:28 (GMT)
Patch [#26799] embedded blenderplayer not receiving keyboard input by Sebastian Korczak
(patch co-reviewed by Nathan Letwory)

Overview: GHOST using rawinput for keyboard input. GHOST window receives WM_INPUT only when it is the active window. Child window cannot be active, so when embedding blenderplayer, WM_INPUT is consumed by top level parent window (for Burster it is the web browser window). Patch register raw input device as 'inputsink' - it makes GHOST window receives all keyboard messages. Window procedure check if GHOST window is active or focused.

::TranslateMessage(&msg) generates WM_CHAR etc. messages from WM_KEYDOWN, WM_KEYUP etc. Because of using RawInput only WM_INPUT messages are processed, so we doesn't need WM_CHAR, WM_KEYDOWN etc. [this is why ::TranslateMessage is no longer getting called].

Note: It's responsibility of the parent window (aka the wrapper) to send WM_SETFOCUS to child window (embedded blenderplayer).
However some parent windows (e.g. webbrowsers) will not send WM_SETFOCUS to the child window when someone clicks on it.
In those cases the blenderplayer needs to be patched to call setFocus(&msg); in the event of WM_LBUTTONDOWN (see GHOST_SystemWin32.cpp)

Commit Details:

Full Hash: 0b03268c17fb4e2b094a01f8b6f43947e2f0826e
SVN Revision: 36542
Parent Commit: 3fe8415
Lines Changed: +14, -1

2 Modified Paths:

/intern/ghost/intern/GHOST_SystemWin32.cpp (+5, -1) (Diff)
/intern/ghost/intern/GHOST_WindowWin32.cpp (+9, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021