From 7f7ea0e1164c4bd5c3f792ff91e08adcbc7ca948 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Sun, 6 Sep 2009 18:56:13 +0200 Subject: [PATCH] mshtml: Added IHTMLEventObj::get_keyCode implementation. --- dlls/mshtml/htmlevent.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index a42098a804..96be69ed57 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -374,8 +374,23 @@ static HRESULT WINAPI HTMLEventObj_put_keyCode(IHTMLEventObj *iface, LONG v) static HRESULT WINAPI HTMLEventObj_get_keyCode(IHTMLEventObj *iface, LONG *p) { HTMLEventObj *This = HTMLEVENTOBJ_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + PRUint32 key_code = 0; + + TRACE("(%p)->(%p)\n", This, p); + + if(This->nsevent) { + nsIDOMKeyEvent *key_event; + nsresult nsres; + + nsres = nsIDOMEvent_QueryInterface(This->nsevent, &IID_nsIDOMKeyEvent, (void**)&key_event); + if(NS_SUCCEEDED(nsres)) { + nsIDOMKeyEvent_GetKeyCode(key_event, &key_code); + nsIDOMKeyEvent_Release(key_event); + } + } + + *p = key_code; + return S_OK; } static HRESULT WINAPI HTMLEventObj_get_button(IHTMLEventObj *iface, LONG *p)