Rafał Miłecki zajec5@gmail.com writes:
@@ -1250,6 +1250,21 @@ void X11DRV_send_keyboard_input( WORD wVk, WORD wScan, DWORD event_flags, DWORD key_state_table[wVkStripped] = key_state_table[wVkL] | key_state_table[wVkR]; }
SERVER_START_REQ( set_global_key_state )
{
req->key = wVk;
req->state = key_state_table[wVk];
wine_server_call( req );
}
SERVER_END_REQ;
SERVER_START_REQ( set_global_key_state )
{
req->key = wVkStripped;
req->state = key_state_table[wVkStripped];
wine_server_call( req );
}
SERVER_END_REQ;
You don't want to add 2 extra server calls for every key, especially since the server already receives the necessary information through the key event.
Hi Alexandre,
W dniu 11 września 2009 13:22 użytkownik Alexandre Julliard julliard@winehq.org napisał:
Rafał Miłecki zajec5@gmail.com writes:
@@ -1250,6 +1250,21 @@ void X11DRV_send_keyboard_input( WORD wVk, WORD wScan, DWORD event_flags, DWORD key_state_table[wVkStripped] = key_state_table[wVkL] | key_state_table[wVkR]; }
- SERVER_START_REQ( set_global_key_state )
- {
- req->key = wVk;
- req->state = key_state_table[wVk];
- wine_server_call( req );
- }
- SERVER_END_REQ;
- SERVER_START_REQ( set_global_key_state )
- {
- req->key = wVkStripped;
- req->state = key_state_table[wVkStripped];
- wine_server_call( req );
- }
- SERVER_END_REQ;
You don't want to add 2 extra server calls for every key, especially since the server already receives the necessary information through the key event.
It's prehistoric thread already, but issue still isn't solved. I wanted to rework that old patch but I noticed set_key_state was already changed and it doesn't change single key state, but instead sets whole array at every call.
This was I can not use set_key_state handler to update my "global_keystate" array, as I have no idea which key actually has been changed.
Do you see some nice solution for this problem?
On 08/16/2010 01:06 PM, Rafał Miłecki wrote:
It's prehistoric thread already, but issue still isn't solved. I wanted to rework that old patch but I noticed set_key_state was already changed and it doesn't change single key state, but instead sets whole array at every call.
This was I can not use set_key_state handler to update my "global_keystate" array, as I have no idea which key actually has been changed.
Do you see some nice solution for this problem?
You can send the whole array (256 bytes isn't all that much, but on every key event - an overkill). Or you can send changes only all at once (comparing arrays isn't all that hard). Lastly you can use Xi2 to receive all key changes, however this won't pick up any injected key events (this is how it works in Wine anyway, so not a big loss of functionality).
Vitaliy.