Add key input handling functionality to the agent. Implement API endpoint for sending key presses with support for action types (tap, down, up) and modifiers. Update web interface to allow users to send keys and toggle modifier states through a new interactive element.
This commit is contained in:
@@ -130,7 +130,25 @@
|
||||
padding: 0.65rem 1.25rem;
|
||||
color: var(--danger);
|
||||
}
|
||||
.error.show { display: block; }
|
||||
nav button.mod-btn.active {
|
||||
background: var(--accent);
|
||||
border-color: var(--accent);
|
||||
color: #fff;
|
||||
}
|
||||
#video-keys {
|
||||
flex: 1;
|
||||
min-width: 12rem;
|
||||
padding: 0.55rem 0.75rem;
|
||||
border: 1px dashed var(--line);
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
cursor: text;
|
||||
outline: none;
|
||||
}
|
||||
#video-keys:focus {
|
||||
border-color: var(--accent);
|
||||
box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -208,12 +226,14 @@
|
||||
<canvas id="video-canvas" width="1280" height="720"></canvas>
|
||||
<p id="video-meta" class="meta"></p>
|
||||
<div class="row" style="margin-top:0.75rem">
|
||||
<input id="video-text" type="text" placeholder="Type text for the focused field">
|
||||
<button id="video-send" class="primary" type="button">Send</button>
|
||||
<label>Key delay
|
||||
<input id="video-key-delay" type="range" min="0" max="200" value="25" style="width:8rem; vertical-align:middle">
|
||||
<span id="video-key-delay-val">25</span> ms
|
||||
</label>
|
||||
<div id="video-keys" tabindex="0">Click here, then type on your keyboard</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<button type="button" class="mod-btn" data-mod="ctrl">Ctrl</button>
|
||||
<button type="button" class="mod-btn" data-mod="alt">Alt</button>
|
||||
<button type="button" class="mod-btn" data-mod="shift">Shift</button>
|
||||
<button type="button" class="mod-btn" data-mod="win">Win</button>
|
||||
<span class="meta">Toggle modifiers, then type in the box above</span>
|
||||
</div>
|
||||
</section>
|
||||
<section id="exec" class="panel">
|
||||
|
||||
Reference in New Issue
Block a user