Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,7 @@ export class BrowserManager {
key?: string;
code?: string;
text?: string;
keyCode?: number;
modifiers?: number; // 1=Alt, 2=Ctrl, 4=Meta, 8=Shift
}): Promise<void> {
const cdp = await this.getCDPSession();
Expand All @@ -1323,6 +1324,8 @@ export class BrowserManager {
key: params.key,
code: params.code,
text: params.text,
windowsVirtualKeyCode: params.keyCode,
nativeVirtualKeyCode: params.keyCode,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nativeVirtualKeyCode: params.keyCode,

Incorrectly setting both windowsVirtualKeyCode and nativeVirtualKeyCode to the same Windows key code value, causing keyboard events to not work correctly on non-Windows platforms (macOS, Linux)

Fix on Vercel

modifiers: params.modifiers ?? 0,
});
}
Expand Down
2 changes: 2 additions & 0 deletions src/stream-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface InputKeyboardMessage {
key?: string;
code?: string;
text?: string;
keyCode?: number;
modifiers?: number;
}

Expand Down Expand Up @@ -215,6 +216,7 @@ export class StreamServer {
key: message.key,
code: message.code,
text: message.text,
keyCode: message.keyCode,
modifiers: message.modifiers,
});
break;
Expand Down