Often-used text-snippets assigned to function-keys

Hi,

it should be possible to assign up to 12 often-used text-snippets (incl. returns) to the 12 function-keys, so that they can be inserted in any text-field of any app with only pressing one of the function-keys.

Best regards,
Lucien

This sounds like a great idea for an extension!

You cannot “insert” text inside an application from the outside. At most, you can put text inside the clipboard, and paste from the application.

1 Like

OK, I understand. Is this for security-reasons? If not, this should be implemented.

But if this is for security there would also be a solution:
if you use the assigned keyboard-shortcut, the function for this functionality could use the clipboard for inserting the text. E.g. like the shortcut for inserting the clipboard a shortcut for the suggested feature could copy the text of that feature into the clipboard and then copy the clipboard to the cursor-position.

No, it’s not for “security reasons” (though those have to factored in). The clipboard is a “pull” protocol: applications say “I have data to put into the clipboard”, and when another application decides to paste the contents of the clipboard, the windowing system will ask the application for the clipboard data.

The operation of pasting has to be initiated by the application itself, after a user request; you cannot have a third party component doing that.

Feel free to look into how this would work. I very much doubt somebody else is going to implement this functionality for you—unless you decide to pay them.

Will it work if we simulate Ctrl+V with something like libinput replay?
We can populate the clipboard with gpaste-client reading a specific text file.

An alternative is to use 2 shortcuts in a row:

  • Copy the relevant file contents to the clipboard.
  • Manually paste the clipboard contents.

Blockquote
The operation of pasting has to be initiated by the application itself, after a user request; you cannot have a third party component doing that.

Well, then it should be no problem, because maybe my description was a little bit confusing.

Of course I didn’t meant that another app should initiate pasting text into an app. But the usecase would be, that you are in an app and want to paste text there. And then you press a shortcut (e.g. super+F1 … super+F12) and the app “asks” (sorry, I’m no programmer) for the contents of this shortcut (similar to the shortcut of the clipboard when pasting this).

So, you use it in an app to paste something into this app and initiate it from this app. The section in the settings are only to define, which text should be assigned to which shortcut.

Basically it’s the same like the function of the clipboard, but not with variable text, but with predefined texts, that you often need in different apps.

It’s a bit like the text-replacement-function of maxOS, but with additional shortcuts. And a bit like the Add-ins “Autotext” for Thunderbird and “Clippings” for Firefox, but systemwide.

Blockquote
I very much doubt somebody else is going to implement this functionality for you—unless you decide to pay them.

Of course this would be a handy feature for mee, too. But I think, this would be very handy for many users… I didn’t post it here, because I wanted it done for me. But to discuss this feature, because I really think this would be very handy for many users…

To make this possible, you’d have to implement it each app

Thank you for the information. This is very sad. Maybe somebody has an idea how to implement this. But if not, this would be the reason. Thank you.

By the way:
how does macOS implement this feature? In the settings of macOS (in the keyboard-section) is exactly this feature, that often used text-snippets can be stored for faster and easier input. And it works in every application.

Maybe this would be an option for Gnome too…

An on-screen keyboard inserts text without the app calling for clipboard contents.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.