本文整理汇总了C++中AccessibilityObject::accessKey方法的典型用法代码示例。如果您正苦于以下问题:C++ AccessibilityObject::accessKey方法的具体用法?C++ AccessibilityObject::accessKey怎么用?C++ AccessibilityObject::accessKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccessibilityObject
的用法示例。
在下文中一共展示了AccessibilityObject::accessKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_accKeyboardShortcut
HRESULT STDMETHODCALLTYPE AccessibleBase::get_accKeyboardShortcut(VARIANT vChild, BSTR* shortcut)
{
if (!shortcut)
return E_POINTER;
*shortcut = 0;
AccessibilityObject* childObj;
HRESULT hr = getAccessibilityObjectForChild(vChild, childObj);
if (FAILED(hr))
return hr;
String accessKey = childObj->accessKey();
if (accessKey.isNull())
return S_FALSE;
static String accessKeyModifiers;
if (accessKeyModifiers.isNull()) {
unsigned modifiers = EventHandler::accessKeyModifiers();
// Follow the same order as Mozilla MSAA implementation:
// Ctrl+Alt+Shift+Meta+key. MSDN states that keyboard shortcut strings
// should not be localized and defines the separator as "+".
if (modifiers & PlatformKeyboardEvent::CtrlKey)
accessKeyModifiers += "Ctrl+";
if (modifiers & PlatformKeyboardEvent::AltKey)
accessKeyModifiers += "Alt+";
if (modifiers & PlatformKeyboardEvent::ShiftKey)
accessKeyModifiers += "Shift+";
if (modifiers & PlatformKeyboardEvent::MetaKey)
accessKeyModifiers += "Win+";
}
*shortcut = BString(accessKeyModifiers + accessKey).release();
return S_OK;
}
示例2: returnString
static const gchar* webkitAccessibleHyperlinkActionGetKeybinding(AtkAction* action, gint index)
{
g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(action), 0);
g_return_val_if_fail(WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv->hyperlinkImpl, 0);
g_return_val_if_fail(!index, 0);
if (!ATK_IS_ACTION(WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv->hyperlinkImpl))
return 0;
AccessibilityObject* coreObject = core(action);
if (!coreObject)
return 0;
return returnString(coreObject->accessKey().string());
}
示例3: core
static const gchar* webkitAccessibleHyperlinkActionGetKeybinding(AtkAction* action, gint index)
{
g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(action), 0);
g_return_val_if_fail(!index, 0);
WebKitAccessibleHyperlinkPrivate* priv = WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv;
g_return_val_if_fail(priv->hyperlinkImpl, 0);
if (!ATK_IS_ACTION(priv->hyperlinkImpl))
return 0;
AccessibilityObject* coreObject = core(action);
if (!coreObject)
return 0;
priv->actionKeyBinding = coreObject->accessKey().string().utf8();
return priv->actionKeyBinding.data();
}