Override shortcut which is used for menus ALT-E

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
pulp
Posts: 34
Joined: 24 May 2016 20:52

Override shortcut which is used for menus ALT-E

Post by pulp »

hi,

i would like to use ALT-E to focus the address bar. But this shortcut is used for the Edit menu. Can I override this key combination for my own needs?

thanks pulp

highend
Posts: 14566
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Override shortcut which is used for menus ALT-E

Post by highend »

You can, but you must adapt your current used language (the translation) for that to work (there you can replace the shortcut)

You can find a guide + translation files here: viewtopic.php?p=86224#p86224

And the bad thing is: With every release you have to modify it again...
One of my scripts helped you out? Please donate via Paypal

pulp
Posts: 34
Joined: 24 May 2016 20:52

Re: Override shortcut which is used for menus ALT-E

Post by pulp »

Thank you for sharing this trick. I changed '&Edit' to 'Ed&it'. Maybe i find a way to automate this string replacement.

pulp

admin
Site Admin
Posts: 64843
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Override shortcut which is used for menus ALT-E

Post by admin »

You could write a script that patches the *.lng file.

highend
Posts: 14566
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Override shortcut which is used for menus ALT-E

Post by highend »

Like so (assuming your .lng file is called "English.lng"):

Code: Select all

Removed, see the next posting that contains the script...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 64843
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Override shortcut which is used for menus ALT-E

Post by admin »

The 01.0463 part is not a fixed number and may change in any future edition. So I would just look for "men.caption:01|&Edit|--|&Edit".

highend
Posts: 14566
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Override shortcut which is used for menus ALT-E

Post by highend »

Is the form number subject to change anytime? So at least the 01. will stay constant?
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 64843
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Override shortcut which is used for menus ALT-E

Post by admin »

Yes, the 01. will stay constant.

highend
Posts: 14566
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Override shortcut which is used for menus ALT-E

Post by highend »

Then you're better off with:

Code: Select all

    $lngFile = "<xydata>\English.lng";
    $edit    = "Ed&it";

    $content = readfile($lngFile);
    $pattern = "^(01.\d+=\s+men\.caption:\d{2}\|&Edit\|--\|)(&Edit)$";
    $content = regexreplace($content, $pattern, "$1$edit");
    writefile($lngFile, $content);
    text "Language file updated, please restart XY now...";
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 64843
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Override shortcut which is used for menus ALT-E

Post by admin »

Another idea: What about an option to remove the accelerators in the top menu? That would free Alt+F, Alt+E, Alt+V etc for being used as KS. And now that I killed that beep we are on easy street...

(Well,there are still some Alt+? accelerators in the Info Panel... should they also be optionally removed then...?)

pulp
Posts: 34
Joined: 24 May 2016 20:52

Re: Override shortcut which is used for menus ALT-E

Post by pulp »

@highend : thank you for the script
@admin: sounds good. I do not need the accelerators in the info panel, so in my point of view yes.

admin
Site Admin
Posts: 64843
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Override shortcut which is used for menus ALT-E

Post by admin »

Well, was a nice idea, but: menu caption first letters are used as default accelerators by Windows :( This makes Alt+F still unusable as normal KS if there is a menu "File". Argh. :evil:

pulp
Posts: 34
Joined: 24 May 2016 20:52

Re: Override shortcut which is used for menus ALT-E

Post by pulp »

admin wrote:Well, was a nice idea, but: menu caption first letters are used as default accelerators by Windows :( This makes Alt+F still unusable as normal KS if there is a menu "File". Argh. :evil:
Cant you override the shortcut? what programming language and UI framework is xyplorer using?

admin
Site Admin
Posts: 64843
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Override shortcut which is used for menus ALT-E

Post by admin »

No. I did not find any way to disable the Windows default accelerators in the menu control. The only way would be to write a custom menu control. Well...

Post Reply