feat: check for keyboard actions

This commit is contained in:
Rohit
2025-01-22 23:51:17 +05:30
parent c0af7fae97
commit 1bc153d949

View File

@@ -490,6 +490,14 @@ export default class Interpreter extends EventEmitter {
const executeAction = async (invokee: any, methodName: string, args: any) => { const executeAction = async (invokee: any, methodName: string, args: any) => {
console.log("Executing action:", methodName, args); console.log("Executing action:", methodName, args);
if (methodName === 'press' || methodName === 'type') {
// Extract only the first two arguments for these methods
const limitedArgs = Array.isArray(args) ? args.slice(0, 2) : [args];
await (<any>invokee[methodName])(...limitedArgs);
return;
}
if (!args || Array.isArray(args)) { if (!args || Array.isArray(args)) {
await (<any>invokee[methodName])(...(args ?? [])); await (<any>invokee[methodName])(...(args ?? []));
} else { } else {