Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

MagMueller
Copy link
Collaborator

@MagMueller MagMueller commented Aug 30, 2025

Auto-generated PR for: fix-windowsVirtualKeyCode


Summary by cubic

Fixes Windows virtual key code handling for simulated typing to match Chrome DevTools behavior. Prevents wrong characters (e.g., !, @, uppercase) and improves reliability of text input on Windows.

  • Bug Fixes
    • Added _get_char_modifiers_and_vk to map characters to modifiers, windowsVirtualKeyCode, and base key (covers shifted symbols, uppercase, digits, and specials).
    • Updated typing flow: keyDown (base key + VK + modifiers) → small delay → char (text) → keyUp (base key + VK + modifiers).
    • Made text clearing more reliable: JS value reset with input/change events, then triple-click + Delete, then platform-aware Cmd/Ctrl+A + Delete.

Copy link

github-actions bot commented Aug 30, 2025

Agent Task Evaluation Results: 2/3 (67%)

View detailed results
Task Result Reason
amazon_laptop ✅ Pass The agent successfully navigated to amazon.com, searched for 'laptop', and returned the name of the first laptop result along with additional relevant details such as price, rating, and deal information. This meets all the criteria specified for the task.
browser_use_pip ✅ Pass The agent correctly identified and provided the pip installation command 'pip install browser-use' as required by the task. The explanation references the official README Quick start section, confirming the accuracy of the command. Therefore, the output meets the success criteria.
captcha_cloudflare ❌ Fail The agent correctly identified that the target page does not contain an interactive captcha widget or a 'Check' button, which prevented it from completing the task as specified. Since the captcha could not be solved and the hostname value could not be extracted, the task is incomplete and unsuccessful.

Check the evaluate-tasks job for detailed task execution logs.

@MagMueller MagMueller merged commit 1ecbca5 into main Aug 30, 2025
46 of 55 checks passed
@MagMueller MagMueller deleted the fix-windowsvirtualkeycode branch August 30, 2025 02:54
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

return (0, no_shift_chars[char], char)

# Fallback
return (0, ord(char.upper()) if char.isalpha() else ord(char), char)
Copy link
Contributor

Choose a reason for hiding this comment

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

Fallback assigns invalid windowsVirtualKeyCode values for non-ASCII chars; use 0 for characters without a defined VK to avoid incorrect key events.

(Based on your team's feedback about matching indentation style, the fix suggestion keeps tab indentation.)

Prompt for AI agents
Address the following comment on browser_use/browser/watchdogs/default_action_watchdog.py at line 653:

<comment>Fallback assigns invalid windowsVirtualKeyCode values for non-ASCII chars; use 0 for characters without a defined VK to avoid incorrect key events.

(Based on your team&#39;s feedback about matching indentation style, the fix suggestion keeps tab indentation.)</comment>

<file context>
@@ -582,6 +582,76 @@ async def _type_to_page(self, text: str):
+			return (0, no_shift_chars[char], char)
+
+		# Fallback
+		return (0, ord(char.upper()) if char.isalpha() else ord(char), char)
+
 	def _get_key_code_for_char(self, char: str) -&gt; str:
</file context>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant