MCPcopy Index your code
hub / github.com/agent0ai/agent-zero / sendKey

Function sendKey

plugins/_browser/webui/browser-store.js:2460–2476  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

2458 },
2459
2460 async sendKey(event) {
2461 if (this.annotating) return;
2462 const contextId = this.normalizeContextId(this.activeBrowserContextId || this.contextId);
2463 if (!contextId || !this.activeBrowserId) return;
2464 if (event.ctrlKey || event.metaKey || event.altKey) return;
2465 const editable = ["INPUT", "TEXTAREA", "SELECT"].includes(event.target?.tagName);
2466 if (editable) return;
2467 event.preventDefault();
2468 const printable = event.key && event.key.length === 1;
2469 await websocket.emit("browser_viewer_input", {
2470 context_id: contextId,
2471 browser_id: this.activeBrowserId,
2472 input_type: "keyboard",
2473 key: printable ? "" : event.key,
2474 text: printable ? event.key : "",
2475 });
2476 },
2477
2478 async sendShortcut(key) {
2479 const contextId = this.normalizeContextId(this.activeBrowserContextId || this.contextId);

Callers

nothing calls this directly

Calls 1

emitMethod · 0.45

Tested by

no test coverage detected