Dylan Smith : richedit:Added tests for ctrl-key shortcut handling in WM_KEYDOWN.

Dmitry Timoshkov dmitry at codeweavers.com
Wed Oct 22 08:22:43 CDT 2008


"Alexandre Julliard" <julliard at winehq.org> wrote:

> +static BOOL hold_key(int vk)
> +{
> +  BYTE key_state[256];
> +  BOOL result;
> +
> +  result = GetKeyboardState((LPBYTE)&key_state);
> +  ok(result, "GetKeyboardState failed.\n");
> +  if (!result) return FALSE;
> +  key_state[vk] |= 0x80;
> +  result = SetKeyboardState((LPBYTE)&key_state);
> +  ok(result, "SetKeyboardState failed.\n");
> +  return result != 0;
> +}
> +
> +static BOOL release_key(int vk)
> +{
> +  BYTE key_state[256];
> +  BOOL result;
> +
> +  result = GetKeyboardState((LPBYTE)&key_state);
> +  ok(result, "GetKeyboardState failed.\n");
> +  if (!result) return FALSE;
> +  key_state[vk] &= ~0x80;
> +  result = SetKeyboardState((LPBYTE)&key_state);
> +  ok(result, "SetKeyboardState failed.\n");
> +  return result != 0;
> +}

This is already committed, but the casts in the above code clearly
show that the pointer syntax is wrong there.

-- 
Dmitry.



More information about the wine-devel mailing list