Shortcut to "Append File" #2564
Tribo-2dot0
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
Not sure if it applies at all to your situation but I use the key-combo: ALT+F then A. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've never understood (and still don't) about codes and programming, but I've ventured into this "vibe coding" with simple html files (small games, etc.) and I think the results are cool.
In need of a shortcut to "Append File", which makes it easier when we have to repeat the act 12 or 15 times, I used Manus to generate a change in the code and guide me on how to apply this change (using VS Code) and how to compile the executable (using Visual Studio 2022), and to my surprise it worked!
First he gave me a code snippet to include in the MainForm.Designer.cs file, but the only change was to include "Ctrl+P" next to "Append File" in the menu; the code was as follows:
// MnFileAppend
//
this.MnFileAppend.Name = "MnFileAppend";
resources.ApplyResources(this.MnFileAppend, "MnFileAppend");
this.MnFileAppend.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); // Line added
this.MnFileAppend.Click += new System.EventHandler(this.MnFileAppend_Click);
I explained what had happened and he gave me another snippet to add, now in the MainForm.cs file, which made the shortcut functional; the snippet is as follows:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
// --- START OF MODIFICATION ---
// Check specifically by Ctrl+P
if (keyData == (Keys.Control | Keys.P))
{
// Calls the Append File action directly
MnFileAppend_Click(null, EventArgs.Empty);
// Alternatively, you could call: Core.OpenFile(null, true);
return true; // Indicates that the key has been processed
}
// --- END OF MODIFICATION ---
I used "Ctrl+P" because this key combination wasn't being used yet, but I don't know if it's the best one.
Sorry if I break any license rules or anything like that, I made the modification and only I've been using it, I also don't understand much about the limits of open source (GitHub itself is a bit confusing for me, I don't even know if this is the right place to post this 😁).
Anyway, I think it would be a useful shortcut to include in a future release.
Beta Was this translation helpful? Give feedback.
All reactions