interface ICoreWebView2AcceleratorKeyPressedEventArgs

Note

This reference is no longer being maintained. For the latest API reference, see WebView2 API Reference.

interface ICoreWebView2AcceleratorKeyPressedEventArgs
  : public IUnknown

Event args for the AcceleratorKeyPressed event.

Summary

Members Descriptions
get_Handled During AcceleratorKeyPressedEvent handler invocation the WebView is blocked waiting for the decision of if the accelerator will be handled by the host or not.
get_KeyEventKind The key event type that caused the event to be fired.
get_KeyEventLParam The LPARAM value that accompanied the window message.
get_PhysicalKeyStatus A structure representing the information passed in the LPARAM of the window message.
get_VirtualKey The Win32 virtual key code of the key that was pressed or released.
put_Handled Sets the Handled property.

Members

get_Handled

During AcceleratorKeyPressedEvent handler invocation the WebView is blocked waiting for the decision of if the accelerator will be handled by the host or not.

public HRESULT get_Handled(BOOL * handled)

If the Handled property is set to TRUE then this will prevent the WebView from performing the default action for this accelerator key. Otherwise the WebView will perform the default action for the accelerator key.

get_KeyEventKind

The key event type that caused the event to be fired.

public HRESULT get_KeyEventKind(COREWEBVIEW2_KEY_EVENT_KIND * keyEventKind)

get_KeyEventLParam

The LPARAM value that accompanied the window message.

public HRESULT get_KeyEventLParam(INT * lParam)

See the documentation for the WM_KEYDOWN and WM_KEYUP messages.

get_PhysicalKeyStatus

A structure representing the information passed in the LPARAM of the window message.

public HRESULT get_PhysicalKeyStatus(COREWEBVIEW2_PHYSICAL_KEY_STATUS * physicalKeyStatus)

get_VirtualKey

The Win32 virtual key code of the key that was pressed or released.

public HRESULT get_VirtualKey(UINT * virtualKey)

This will be one of the Win32 virtual key constants such as VK_RETURN or an (uppercase) ASCII value such as 'A'. You can check whether Ctrl or Alt are pressed by calling GetKeyState(VK_CONTROL) or GetKeyState(VK_MENU).

put_Handled

Sets the Handled property.

public HRESULT put_Handled(BOOL handled)