Re: [AD] Problem with key_shifts on Windows. |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Fri, 2006-04-28 at 17:33 +0200, Andrei Ellman wrote:
Does remving the following in src/win/wkeybd.c change anything?
/* ignore special Windows keys (alt+tab, alt+space, (ctrl|alt)+esc) */
if (((scancode == DIK_TAB) && (_key_shifts & KB_ALT_FLAG))
|| ((scancode == DIK_SPACE) && (_key_shifts & KB_ALT_FLAG))
|| ((scancode == DIK_ESCAPE) && (_key_shifts & (KB_CTRL_FLAG | KB_ALT_FLAG))))
return;
I'm not in windows myself right now, and I only can get access to
Windows XP, so there's not much I can do, but maybe you can try to find
something out yourself..
The keyboard driver basically works like this: Whenever a DirectInput
keyboard event occurs, the function "key_dinput_handle" is called, which
in turn calls "key_dinput_handle_scancode" for each single scancode.
There already some magic seems to be done, and in most cases,
"handle_key_press" and "handle_key_release" get the scancodes, to
process them further, and then finally send them to Allegro
(_handle_key_press/_handle_key_release from keyboard.c).
Maybe as first step, you can make the function "key_dinput_handle" print
out what it gets (you can get a console and print to it with printf
under Windows I think, don't know though), or otherwise write to the log
file, e.g. with:
TRACE("%d %d\n", scancode, pressed);
You write a line for each scancode to allegro.log, when compiled in
debug mode.
If everything looks correct from there, the problem must be in the pass
until the scancode gets to _handle_key_press/_handle_key_release. If the
keys already aren't correct there, then the problem must be further up
with DirectInput.
--
Elias Pschernig