File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
interpreter/computer_use/tools Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,21 @@ async def __call__(
162
162
if action == "key" :
163
163
if platform .system () == "Darwin" : # Check if we're on macOS
164
164
text = text .replace ("super+" , "command+" )
165
- keys = text .split ("+" )
165
+
166
+ # Normalize key names
167
+ def normalize_key (key ):
168
+ key = key .lower ().replace ("_" , "" )
169
+ key_map = {
170
+ "pagedown" : "pgdn" ,
171
+ "pageup" : "pgup" ,
172
+ "enter" : "return" ,
173
+ "return" : "enter" ,
174
+ # Add more mappings as needed
175
+ }
176
+ return key_map .get (key , key )
177
+
178
+ keys = [normalize_key (k ) for k in text .split ("+" )]
179
+
166
180
if len (keys ) > 1 :
167
181
if "darwin" in platform .system ().lower ():
168
182
# Use AppleScript for hotkey on macOS
@@ -181,7 +195,7 @@ async def __call__(
181
195
else :
182
196
pyautogui .hotkey (* keys )
183
197
else :
184
- pyautogui .press (text )
198
+ pyautogui .press (keys [ 0 ] )
185
199
elif action == "type" :
186
200
pyautogui .write (text , interval = TYPING_DELAY_MS / 1000 )
187
201
You can’t perform that action at this time.
0 commit comments