Add Remote controller capture IPC to the host and both SDKs

remote.focus lets a controller keyboard-capture lease ask core to enter
or leave remote focus; the reply acknowledges admission only. Core
reports the actual state with remote.focus events and forwards routed
transitions as remote.input events carrying the source keycode and, on
fresh presses, a canonical key name. A full focus mailbox revokes the
lease; revocation drains pending focus work. No native capture owner is
attached yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chase CichorzandClaude Opus 5.5 committed 2026-11-06 16:06:38 -05:00
1 parent 27017bef11
commit 2d5327adf4
10 files changed
+583 -10

No files matched your search

+12
View File
@@ -191,6 +191,16 @@ func (session *Session) revoke_remote_locked(reason string, notify bool) {
}
}
}
if session.remoteCapture != nil {
drainCapture:
for {
select {
case <-session.remoteCapture:
default:
break drainCapture
}
}
}
if session.remoteKeys != nil {
drainKeys:
for {
@@ -280,6 +290,8 @@ func (session *Session) remote_call_locked(method string, params json.RawMessage
return session.remote_present_locked(params)
case "remote.key":
return session.remote_key_locked(params)
case "remote.focus":
return session.remote_focus_locked(params)
case "remote.open":
var request tentaclewire.RemoteOpen
if decode_strict(params, &request) != nil || len(request.Action) != 32 || request.Epoch == 0 || !tentaclewire.ValidRoleGrants(request.Role, request.Grants) {