giosilvi / GPT-Prompter

Browser extension to get a fast prompt (of the selected text) for OpenAI`s GPT-3, GPT-4 & ChatGPT API . Available in the Chrome web store and Firefox browser add-ons
https://chrome.google.com/webstore/detail/gpt-prompter/lcgpdbficokndjodlcgflbhaibicompp/overview
MIT License
226 stars 54 forks source link

keyboard shortcut #22

Closed shanelindsay closed 1 year ago

shanelindsay commented 1 year ago

It is a very nice extension but a little fiddly using a mouse. It would be nice to have a keyboard shortcut to activate. The simplest case would be just for prompt on the fly. So a nice keyboard flow is the following:

  1. press shortcut to activate "prompt on the fly" - if selected text then that populates text box otherwise is blank
  2. edit as necessary
  3. tab - enter to submit
  4. wait for finish
  5. tab - enter to copy
  6. dismiss dialogue box (perhaps with escape?)

2 - 5 are currently the existing functionality step 1 is the suggestion to add - and adding 6 would also be a suggested new feature.

Of course, one would miss the other saved prompts - so there could be way to have these accessible via the keyboard prompt as well - such as pressing tab to a drop down menu where you could use arrow keys to select. But the first step would be the shortcuts as suggested above.

giosilvi commented 1 year ago

Hi @shanelindsay , it`s a good idea. for the moment the combination to submit is ctrl+enter. I ll look into adding the functionalities. But having tab+enter in 2 functionality I think is gonna cause issues, as the user could reuse it to re-submit the prompt.

giosilvi commented 1 year ago

Hi @shanelindsay, I published a new version with a set of shortcuts (one can see them when opening a prompt on-the-fly. I didn`t add one for copy yet, first I want to see if the one added works fine or if there might be some conflict with other shortcuts.

shanelindsay commented 1 year ago

great, this works nicely. A minor UI thing is that it cuts off the text "Esc to" Better might be (less text): Prompt-on-the fly (Alt+P to open, Alt-enter to submit/stop, Esc to dismiss)

I thought it previously was the case that you could tab to copy? Doesn't seem possible. But I think your suggestion is for a shortcut for copy? This would be good. Actually, I think in most cases you might want copy and then close. So in text based workflows then you might have some text, you select it, hit alt+p to prompt, add some prefacing command, wait for generating, hit a shortcut to copy (e.g. ctrl+c or alt+c) and dismiss the box, then copy and paste into the document you were working on. In most cases I don't want to see the dialogue box once I have generated the text - I want to do something with the text. Though Esc is also fine (i.e. it could just be a copy command, and the user can press Esc).

giosilvi commented 1 year ago

Good point about the text, I missed it ( btw one can double-click the upper part to expand it). The tab key can still move the focus within the buttons of the popup (but is not optimal I think). But yes, I'll probably add a simple alt+c, because if I use ctrl+c this might interfere when the user wants to just copy part of the completion and not the whole text. Next days will deliver this modifications

giosilvi commented 1 year ago

Ok, I added all shortcuts in tomorrow`s release. Good suggestion, thanks!