mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix: enable right click to paste
This commit is contained in:
parent
42c30985c7
commit
3030a9fcf9
2 changed files with 17 additions and 0 deletions
|
|
@ -617,6 +617,14 @@ export function handleMouseEvent(app: App, m: ParsedMouse): void {
|
|||
// Non-left press breaks the multi-click chain.
|
||||
app.clickCount = 0
|
||||
|
||||
// Forward middle/right button presses to the DOM so components can
|
||||
// react (e.g. right-click-to-paste on input fields). Middle/right
|
||||
// don't participate in selection, multi-click, or hyperlink UX, so
|
||||
// we just dispatch and exit without setting mouseCaptureTarget —
|
||||
// the matching release (if any) falls through the release path and
|
||||
// is ignored there because baseButton !== 0 && !sel.isDragging.
|
||||
app.props.onMouseDownAt(col, row, baseButton)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -671,6 +671,15 @@ export function TextInput({
|
|||
setCur(next)
|
||||
curRef.current = next
|
||||
}}
|
||||
onMouseDown={(e: { button: number }) => {
|
||||
// Right-click to paste: route through the same hotkey path as
|
||||
// Alt+V so the composer's clipboard RPC (text or image) handles it.
|
||||
if (!focus || e.button !== 2) {
|
||||
return
|
||||
}
|
||||
|
||||
emitPaste({ cursor: curRef.current, hotkey: true, text: '', value: vRef.current })
|
||||
}}
|
||||
ref={boxRef}
|
||||
>
|
||||
<Text wrap="wrap">{rendered}</Text>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue