Jump to content
Not connected, Your IP: 18.220.16.184
silph

Suggestion: Remove CTRL + A to open about menu in Eddie

Recommended Posts

Hi,

I believe that CTRL + A should be removed as a shortcut to the about menu in Eddie.

Usually CTRL + A selects all text in a field, and when logging in I occasionally mistype my password, and then when I CTRL + A to select the whole password box it brings up the about menu. Is there any chance that you could look into changing this behavior?

Thanks

Share this post


Link to post

Confirmed, looks like a bug.

I was feeling quite adventurous and got to digging: The key combos are in L487 of Main.cs. I added two exceptions for these fields in the shortcut definition of CTRL+A. This is the resulting patch:

From 5fc7a8c1e8645caa9405523e47601280b556104b Mon Sep 17 00:00:00 2001
From: OpenSorcerer <alex@opensourcery.eu>
Date: Fri, 25 Mar 2022 19:23:19 +0100
Subject: [PATCH] Fix global override of CTRL-A text field shortcut

---
 src/Lib.Forms/Forms/Main.cs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Lib.Forms/Forms/Main.cs b/src/Lib.Forms/Forms/Main.cs
index c06be67..c1b2451 100644
--- a/src/Lib.Forms/Forms/Main.cs
+++ b/src/Lib.Forms/Forms/Main.cs
@@ -493,7 +493,7 @@ namespace Eddie.Forms.Forms
                 OnShowMenu();
             }
 
-            if (e.Control && e.KeyCode == Keys.A)
+            if ((e.Control && e.KeyCode == Keys.A) && !(txtLogin.ContainsFocus ^ txtPassword.ContainsFocus))
             {
                 OnShowAbout();
             }
@@ -2503,4 +2503,4 @@ namespace Eddie.Forms.Forms
             Engine.Instance.NetLockOut();
         }
     }
-}
\ No newline at end of file
+}
--
2.35.1
 

I don't know much about C#, so maybe there's a more clever way of solving this (e.g., make text fields have a higher "priority" when they get focus or something) but this hotfix does its job. You can apply this patch quite easily if you're on Linux; but I'm guessing you're not. Still, could be interesting for others.

Here's a funny story: I needed more than an hour to come up with this. Seriously. I took the eddie-ui-git PKGBUILD, added the patch file and simply rebuilt the package. My idea was to simply edit the patch file if I did any mistake, and I did one or two. So I started rebuilding it over and over again with different solutions because it somehow still didn't work, rebuilt it like 20 times or so. Maybe I did something wrong with negation? Maybe && instead of &? My mood seriously began to turn towards the end – am I really unable to write the simplest logical operations?
Turns out, I was probably doing it right all this time. After more than a hour of experimenting and reading the C# reference I noticed I was editing the source file – which got overridden everytime I built the package with makepkg (auto-applies the patch file still containing the not working evaluation from my first or second try or so).

One line of code, one hour of "work". But now I know more about C# than I ever wanted, really. :D

NOT AN AIRVPN TEAM MEMBER. USE TICKETS FOR PROFESSIONAL SUPPORT.

LZ1's New User Guide to AirVPN « Plenty of stuff for advanced users, too!

Want to contact me directly? All relevant methods are on my About me page.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image

×
×
  • Create New...