本文整理汇总了C++中KeyboardEvent::initKeyboardEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyboardEvent::initKeyboardEvent方法的具体用法?C++ KeyboardEvent::initKeyboardEvent怎么用?C++ KeyboardEvent::initKeyboardEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyboardEvent
的用法示例。
在下文中一共展示了KeyboardEvent::initKeyboardEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jsKeyboardEventPrototypeFunctionInitKeyboardEvent
JSValue* jsKeyboardEventPrototypeFunctionInitKeyboardEvent(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
if (!thisValue->isObject(&JSKeyboardEvent::s_info))
return throwError(exec, TypeError);
JSKeyboardEvent* castedThisObj = static_cast<JSKeyboardEvent*>(thisValue);
KeyboardEvent* imp = static_cast<KeyboardEvent*>(castedThisObj->impl());
const UString& type = args[0]->toString(exec);
bool canBubble = args[1]->toBoolean(exec);
bool cancelable = args[2]->toBoolean(exec);
DOMWindow* view = toDOMWindow(args[3]);
const UString& keyIdentifier = args[4]->toString(exec);
unsigned keyLocation = args[5]->toInt32(exec);
bool ctrlKey = args[6]->toBoolean(exec);
bool altKey = args[7]->toBoolean(exec);
bool shiftKey = args[8]->toBoolean(exec);
bool metaKey = args[9]->toBoolean(exec);
bool altGraphKey = args[10]->toBoolean(exec);
imp->initKeyboardEvent(type, canBubble, cancelable, view, keyIdentifier, keyLocation, ctrlKey, altKey, shiftKey, metaKey, altGraphKey);
return jsUndefined();
}
示例2: jsKeyboardEventPrototypeFunctionInitKeyboardEvent
JSValue JSC_HOST_CALL jsKeyboardEventPrototypeFunctionInitKeyboardEvent(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
UNUSED_PARAM(args);
if (!thisValue.inherits(&JSKeyboardEvent::s_info))
return throwError(exec, TypeError);
JSKeyboardEvent* castedThisObj = static_cast<JSKeyboardEvent*>(asObject(thisValue));
KeyboardEvent* imp = static_cast<KeyboardEvent*>(castedThisObj->impl());
const UString& type = args.at(0).toString(exec);
bool canBubble = args.at(1).toBoolean(exec);
bool cancelable = args.at(2).toBoolean(exec);
DOMWindow* view = toDOMWindow(args.at(3));
const UString& keyIdentifier = args.at(4).toString(exec);
unsigned keyLocation = args.at(5).toInt32(exec);
bool ctrlKey = args.at(6).toBoolean(exec);
bool altKey = args.at(7).toBoolean(exec);
bool shiftKey = args.at(8).toBoolean(exec);
bool metaKey = args.at(9).toBoolean(exec);
bool altGraphKey = args.at(10).toBoolean(exec);
imp->initKeyboardEvent(type, canBubble, cancelable, view, keyIdentifier, keyLocation, ctrlKey, altKey, shiftKey, metaKey, altGraphKey);
return jsUndefined();
}