MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / pressWebDriverKey

Function pressWebDriverKey

javascript/atoms/typescript/type.ts:163–171  ·  view source on GitHub ↗
(keyboard: Keyboard, key: Key)

Source from the content-addressed store, hash-verified

161
162// A modifier toggles; anything else is pressed and released.
163function pressWebDriverKey(keyboard: Keyboard, key: Key): void {
164 if (!isModifier(key)) {
165 tap(keyboard, key)
166 } else if (keyboard.isPressed(key)) {
167 keyboard.releaseKey(key)
168 } else {
169 keyboard.pressKey(key)
170 }
171}
172
173function tap(keyboard: Keyboard, key: Key): void {
174 keyboard.pressKey(key)

Callers 1

typeFunction · 0.85

Calls 5

isModifierFunction · 0.85
tapFunction · 0.85
isPressedMethod · 0.80
releaseKeyMethod · 0.80
pressKeyMethod · 0.80

Tested by

no test coverage detected