mirror of
				https://github.com/microsoft/playwright.git
				synced 2025-06-26 21:40:17 +00:00 
			
		
		
		
	chore(bidi): support ControlOrMeta key (#34341)
This commit is contained in:
		
							parent
							
								
									224d7bf847
								
							
						
					
					
						commit
						07f425434d
					
				| @ -19,6 +19,7 @@ import type * as types from '../types'; | |||||||
| import type { BidiSession } from './bidiConnection'; | import type { BidiSession } from './bidiConnection'; | ||||||
| import * as bidi from './third_party/bidiProtocol'; | import * as bidi from './third_party/bidiProtocol'; | ||||||
| import { getBidiKeyValue } from './third_party/bidiKeyboard'; | import { getBidiKeyValue } from './third_party/bidiKeyboard'; | ||||||
|  | import { resolveSmartModifierString } from '../input'; | ||||||
| 
 | 
 | ||||||
| export class RawKeyboardImpl implements input.RawKeyboard { | export class RawKeyboardImpl implements input.RawKeyboard { | ||||||
|   private _session: BidiSession; |   private _session: BidiSession; | ||||||
| @ -32,12 +33,14 @@ export class RawKeyboardImpl implements input.RawKeyboard { | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   async keydown(modifiers: Set<types.KeyboardModifier>, keyName: string, description: input.KeyDescription, autoRepeat: boolean): Promise<void> { |   async keydown(modifiers: Set<types.KeyboardModifier>, keyName: string, description: input.KeyDescription, autoRepeat: boolean): Promise<void> { | ||||||
|  |     keyName = resolveSmartModifierString(keyName); | ||||||
|     const actions: bidi.Input.KeySourceAction[] = []; |     const actions: bidi.Input.KeySourceAction[] = []; | ||||||
|     actions.push({ type: 'keyDown', value: getBidiKeyValue(keyName) }); |     actions.push({ type: 'keyDown', value: getBidiKeyValue(keyName) }); | ||||||
|     await this._performActions(actions); |     await this._performActions(actions); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   async keyup(modifiers: Set<types.KeyboardModifier>, keyName: string, description: input.KeyDescription): Promise<void> { |   async keyup(modifiers: Set<types.KeyboardModifier>, keyName: string, description: input.KeyDescription): Promise<void> { | ||||||
|  |     keyName = resolveSmartModifierString(keyName); | ||||||
|     const actions: bidi.Input.KeySourceAction[] = []; |     const actions: bidi.Input.KeySourceAction[] = []; | ||||||
|     actions.push({ type: 'keyUp', value: getBidiKeyValue(keyName) }); |     actions.push({ type: 'keyUp', value: getBidiKeyValue(keyName) }); | ||||||
|     await this._performActions(actions); |     await this._performActions(actions); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Yury Semikhatsky
						Yury Semikhatsky