diff --git a/templates/python/computer-use/tools/computer.py b/templates/python/computer-use/tools/computer.py index 1a7f39e..9d305d9 100644 --- a/templates/python/computer-use/tools/computer.py +++ b/templates/python/computer-use/tools/computer.py @@ -22,6 +22,7 @@ MODIFIER_KEY_MAP = { 'ctrl': 'Control', 'alt': 'Alt', + 'cmd': 'Meta', 'command': 'Meta', 'win': 'Meta', } @@ -37,7 +38,9 @@ 'home': 'Home', 'end': 'End', 'pageup': 'PageUp', + 'page_up': 'PageUp', 'pagedown': 'PageDown', + 'page_down': 'PageDown', 'delete': 'Delete', 'backspace': 'Backspace', 'tab': 'Tab', @@ -57,6 +60,9 @@ 'f10': 'F10', 'f11': 'F11', 'f12': 'F12', + 'minus': '-', + 'equal': '=', + 'plus': '+', } Action_20241022 = Literal[ diff --git a/templates/typescript/computer-use/tools/utils/keyboard.ts b/templates/typescript/computer-use/tools/utils/keyboard.ts index f7aadbe..244cddf 100644 --- a/templates/typescript/computer-use/tools/utils/keyboard.ts +++ b/templates/typescript/computer-use/tools/utils/keyboard.ts @@ -3,6 +3,7 @@ export class KeyboardUtils { private static readonly modifierKeyMap: Record = { 'ctrl': 'Control', 'alt': 'Alt', + 'cmd': 'Meta', 'command': 'Meta', 'win': 'Meta', }; @@ -18,7 +19,9 @@ export class KeyboardUtils { 'home': 'Home', 'end': 'End', 'pageup': 'PageUp', + 'page_up': 'PageUp', 'pagedown': 'PageDown', + 'page_down': 'PageDown', 'delete': 'Delete', 'backspace': 'Backspace', 'tab': 'Tab', @@ -38,7 +41,10 @@ export class KeyboardUtils { 'f10': 'F10', 'f11': 'F11', 'f12': 'F12', - }; + 'minus': '-', + 'equal': '=', + 'plus': '+', + }; static isModifierKey(key: string | undefined): boolean { if (!key) return false;