Is it possible to override the return key only in specific fields inside an app like Claude Desktop or Claude Code?
In many LLM apps, the return key sends the message to the model. Of course, like any civilized person, I believe the return key means a new line. CMD+Enter is one true way to send the message. (Sorry, I need some humour here)
I could easily override the return key for the entire app, but I'm not sure that is the right thing to do.
Is there a way to do this? Or
Is there another workaround? (Perhaps, I live with overriding the return key for the entire app?)
I'm tired of typing normally and sending a partial message to the model.
I have this problem too. This behavior of return/enter is not a wise choice.
Yes, but unfortunately not with KM. Sometimes a kind of workaround via a menu that may or may not be available works, but as you can read in this forum, this solution is not really satisfactory.
That's understandable. But just get out of the habit of using that key. AI isn't interested in visually structured text. Only press the key when you want to send the text. I'm getting pretty good at it now.
If you show me two screenshots, (a) a screenshot of the entire app when your text cursor is in the field that you want the key modified, and (b) a screenshot of the entire app when your text cursor is NOT in that field, then I may be able to solve this problem with the use of the KM Find Image action. The logic would be "if an image is present then replace the key, otherwise don't replace it."
Oddly enough, I was just checking this and I might be able to get away with incerpting the return key anywhere in the app and sending Shift+Enter instead.
But what does the Return key do if you haven't entered any text in the field? Until you do the "Send" button isn't active, so a Return may be treated normally. And you might get away with image-detecting the "Send" button, which changes colour as soon as there's something entered in the field...
Thanks for the compliment. My philosophy is, "if a human can do it, so can a KM macro." So I just ask myself how would a human do it, and I get my solution.
Nige's solution may be close to what you need. However I would personally use OCR instead of Find Image. And yes, it is possible to use OCR, even though you might think it isn't.
Finally took the time to try this out. Thanks to both @Airy for providing the solution and @Nige_S for helping to start me thinking in the right direction.
@Frankb come join us in the happy land, where we don’t need to override our brains to fix Claude Desktop.