MCPcopy Create free account
hub / github.com/WhiteSevs/TamperMonkeyScript / onKeyboard

Method onKeyboard

lib/DOMUtils/src/ElementEvent.ts:1385–1420  ·  view source on GitHub ↗

* 监听某个元素键盘按键事件或window全局按键事件 * 按下有值的键时触发,按下Ctrl\Alt\Shift\Meta是无值键。按下先触发keydown事件,再触发keypress事件。 * @param element 需要监听的对象,可以是全局Window或者某个元素 * @param eventName 事件名,默认keypress,keydown - > keypress - > keyup * @param handler 自己定义的回调事件,参数1为当前的key,参数2为组合按键,数组类型,包含ctrl、shift、alt和meta(win键或mac的c

(
    element: DOMUtilsTargetElementType | Element | DocumentFragment | Window | Node | typeof globalThis,
    eventName: "keydown" | "keyup" = "keydown",
    handler: (keyName: string, keyValue: number, otherCodeList: string[], event: KeyboardEvent) => void,
    options?: DOMUtilsEventListenerOption | boolean
  )

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 15

setListenKeyboardMethod · 0.80
enterShortcutKeysMethod · 0.80
showViewMethod · 0.80
importRulesMethod · 0.80
importSubscribeMethod · 0.80
importConfigFunction · 0.80
importRuleFunction · 0.80
showViewFunction · 0.80
optimizationSearchFunction · 0.80
importRuleFunction · 0.80
importSubscribeMethod · 0.80
NetDiskNewAccessCodeViewFunction · 0.80

Calls 2

selectorAllMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected