From 07f425434d9ad3674e8ecd207016d40af93fc38a Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Wed, 15 Jan 2025 13:23:44 -0800 Subject: [PATCH] chore(bidi): support ControlOrMeta key (#34341) --- packages/playwright-core/src/server/bidi/bidiInput.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/playwright-core/src/server/bidi/bidiInput.ts b/packages/playwright-core/src/server/bidi/bidiInput.ts index e149bb4a3f..cf6770a479 100644 --- a/packages/playwright-core/src/server/bidi/bidiInput.ts +++ b/packages/playwright-core/src/server/bidi/bidiInput.ts @@ -19,6 +19,7 @@ import type * as types from '../types'; import type { BidiSession } from './bidiConnection'; import * as bidi from './third_party/bidiProtocol'; import { getBidiKeyValue } from './third_party/bidiKeyboard'; +import { resolveSmartModifierString } from '../input'; export class RawKeyboardImpl implements input.RawKeyboard { private _session: BidiSession; @@ -32,12 +33,14 @@ export class RawKeyboardImpl implements input.RawKeyboard { } async keydown(modifiers: Set, keyName: string, description: input.KeyDescription, autoRepeat: boolean): Promise { + keyName = resolveSmartModifierString(keyName); const actions: bidi.Input.KeySourceAction[] = []; actions.push({ type: 'keyDown', value: getBidiKeyValue(keyName) }); await this._performActions(actions); } async keyup(modifiers: Set, keyName: string, description: input.KeyDescription): Promise { + keyName = resolveSmartModifierString(keyName); const actions: bidi.Input.KeySourceAction[] = []; actions.push({ type: 'keyUp', value: getBidiKeyValue(keyName) }); await this._performActions(actions);