Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature Request: Global OS shortcut to insert snippet into application#206

pcgeek86 started this conversation inIdeas
Discussion options

Summary

It would be awesome if I could use massCode as a general purpose clipboard manager on Windows 11.

Expected Result

Register a global keyboard shortcut, for each operating system, that enables you to search for and inject a code snippet into another running application. For example, while using Google Chrome, I want to insert a massCode snippet into a text editor inside a webpage, in the browser. PressingCTRL + SHIFT + F10 opens a massCode search box, I type a search term, select the desired snippet with the up/down arrow keys, and then hitENTER to insert the snippet into the Google Chrome application window.

Actual Result

Feature does not currently exist.

Implementation Details

This document shows how to implement global OS hotkeys in Electron.js:https://www.electronjs.org/docs/latest/api/global-shortcut

You must be logged in to vote

Replies: 2 comments 2 replies

Comment options

I'm not sure if it's possible to implement the insertion in another application.

As for the quick search, there was already a request. I'll think about the implementation.

You must be logged in to vote
1 reply
@mt3o
Comment options

Technically it's possible, the version that's very cross-platform because it relies on java is here:
https://www.npmjs.com/package/node-key-sender
otherwise you need to use native platform calls, so with node it would be:https://koffi.dev/ orhttps://www.npmjs.com/package/ffi

On the other hand, a very reasonable solution is to have a global shortcut (windows default clipboard manager uses meta+v to trigger the manager) that brings the helper window, and on selecting - just put the contents into the clipboard. This way you don't have to type the content on your own.

https://www.electronjs.org/docs/latest/api/clipboard
https://www.geeksforgeeks.org/clipboard-api-in-electronjs/

The window for selecting the snippet on global shortcut should be a frameless window
https://www.geeksforgeeks.org/frameless-window-in-electronjs/

Comment options

FYI - I copied / pasted this from the documentation in Electron linked in the initial commentabove by@pcgeek86:

Note

The shortcut is global;it will work even if the app does not have the keyboard focus. This module cannot be used before the ready event of the app module is emitted.

You must be logged in to vote
1 reply
@Hornbaek
Comment options

I have a similar idea and I post it here instead of starting a new one :)

I would like to suggest a feature that enhances snippet insertion efficiency within massCode. The idea is to implement a text expander functionality triggered by a specific shortcut (e.g., §1).

Proposed Functionality:

Trigger: Typing a designated shortcut (e.g., §1) within the editor.

  • Action: Upon detecting the shortcut, massCode would display a pop-up menu listing all snippets contained in a specific folder (e.g., folder 'X').
  • Selection: Each snippet in the list would be associated with a number. Pressing the corresponding number key would insert the selected snippet into the editor at the cursor's position.

Benefits:

  • Streamlines the process of inserting frequently used snippets.
  • Reduces the need to navigate through folders manually.
  • Enhances productivity by allowing quick access to organized snippets.

Considerations:

  • The shortcut key (e.g., §1) should be customizable to avoid conflicts with existing keybindings.
  • The feature should support different folders, allowing users to define shortcuts for various snippet categories.
  • Implementing a preview of the snippet content in the pop-up could further aid in selection.

I believe this feature would significantly improve the user experience for those who rely heavily on organized snippets.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Ideas
Labels
None yet
5 participants
@pcgeek86@mt3o@antonreshetov@Hornbaek@pa-0

[8]ページ先頭

©2009-2025 Movatter.jp