From 4947c70fe27f343432ff017f21415ceb69426161 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 6 Feb 2018 00:10:19 +0100 Subject: [PATCH] mshtml: Added IDOMKeyboardEvent key state getters implementation. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/mshtml/htmlevent.c | 65 ++++++++++++++++++++++++++++++++++------- 1 file changed, 55 insertions(+), 10 deletions(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 14ab00dd8ae..c11f6d13dca 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -1715,36 +1715,81 @@ static HRESULT WINAPI DOMKeyboardEvent_get_location(IDOMKeyboardEvent *iface, UL static HRESULT WINAPI DOMKeyboardEvent_get_ctrlKey(IDOMKeyboardEvent *iface, VARIANT_BOOL *p) { DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + cpp_bool r; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsres = nsIDOMKeyEvent_GetCtrlKey(This->keyboard_event, &r); + if(NS_FAILED(nsres)) + return E_FAIL; + + *p = variant_bool(r); + return S_OK; } static HRESULT WINAPI DOMKeyboardEvent_get_shiftKey(IDOMKeyboardEvent *iface, VARIANT_BOOL *p) { DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + cpp_bool r; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsres = nsIDOMKeyEvent_GetShiftKey(This->keyboard_event, &r); + if(NS_FAILED(nsres)) + return E_FAIL; + + *p = variant_bool(r); + return S_OK; } static HRESULT WINAPI DOMKeyboardEvent_get_altKey(IDOMKeyboardEvent *iface, VARIANT_BOOL *p) { DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + cpp_bool r; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsres = nsIDOMKeyEvent_GetAltKey(This->keyboard_event, &r); + if(NS_FAILED(nsres)) + return E_FAIL; + + *p = variant_bool(r); + return S_OK; } static HRESULT WINAPI DOMKeyboardEvent_get_metaKey(IDOMKeyboardEvent *iface, VARIANT_BOOL *p) { DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + cpp_bool r; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsres = nsIDOMKeyEvent_GetMetaKey(This->keyboard_event, &r); + if(NS_FAILED(nsres)) + return E_FAIL; + + *p = variant_bool(r); + return S_OK; } static HRESULT WINAPI DOMKeyboardEvent_get_repeat(IDOMKeyboardEvent *iface, VARIANT_BOOL *p) { DOMEvent *This = impl_from_IDOMKeyboardEvent(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + cpp_bool r; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsres = nsIDOMKeyEvent_GetRepeat(This->keyboard_event, &r); + if(NS_FAILED(nsres)) + return E_FAIL; + + *p = variant_bool(r); + return S_OK; } static HRESULT WINAPI DOMKeyboardEvent_getModifierState(IDOMKeyboardEvent *iface, BSTR key,