#1 2024-09-29 18:45

Elektro
Senior Member
Registered: 2014-05-28
Posts: 76

[REQUEST] Capability to edit shortcut key ALT+F4 (accelerator table?)

Hi!

I do not wish to treat what I am going to request as a matter of absolute necessity. I am aware that it may seem like a somewhat unusual and very low priority request, but it is something that would help me to be more productive (reduce time) and that is why I am going to suggest it:

It could be possible to let the end user modify the short cut keys for menu items?:

Menu items

If this is not possible or it is just something that the developer will prefer not to do it, then this is my secondary request:

Could you help me to let me know how can I modify, through reverse engineering, the ALT+F4 hotkey for a ESCAPE key instead? (to close the program using ESCAPE key).

I have very basic knowledge of reverse engineering. By very basic I mean insufficient and incompetent to do advanced things, but basic enough to understand some basic things.

In other programs, such as the Winamp audio player, when opening the executable file in a resource editor like Resource Hacker, there is a resource folder named "Accelerators" in which I can modify the program's hotkeys to my liking by changing the Virtual Key codes.

Winamp..exe Accelerators table

But this resrouce folder is not present in the Renamer.exe executable file.

It could be possible to implement this resource on Renamer.exe executable?.

On my last attempt, I also tried to open the Renamer.exe in a debugger (x64dbg) to try find the event-handler method that is handling the ALT+F4 key press for that menu item, but this kind of reverse engineering is something that is beyond my knowledge. I can't even find the WNDPROC procedure that processes the WM_KEYDOWN / WM_KEYUP messages, and anyway I am not able to understand disassembler code from this debugger to know what I'm doing.

So that's where my attempt ends.

I am able to develop a simple console program (or a Windows service) in .NET, or just a script with AutoHotkey, that keeps running in background and intercepts an ESCAPE key press in my keyboard to send ALT+F4 to the Renamer window that has the focus, that would do the job for me, but I only consider this as a last resort, because I don't like the idea of keep running external tools / dependencies just to be able use a different hotkey in a specific program. So I would prefer to know if there is a possibility of finding a more direct solution, by modifying the executable file through reverse engineering, or by implementing this capability directly in Renamer's user-interface settings page.

Thanks for your time!

Last edited by Elektro (2024-09-29 18:55)

Offline

#2 2024-09-29 19:18

Elektro
Senior Member
Registered: 2014-05-28
Posts: 76

Re: [REQUEST] Capability to edit shortcut key ALT+F4 (accelerator table?)

Regarding the Renamer's UI settings page, It could be presented in the following way ( It's just an idea to help motivate you big_smile )

UI Idea

Keys Dropdown

The truth is that Renamer is already a very complete program. Maybe I'm wrong but I don't think there are many new ideas to continue adding to this program, because it is very complete in its renaming functionality, so perhaps considering the idea of implementing this kind of personalization is not so bad, so that Renamer can be more complete in other aspects appart from its renaming functionalities, such as the one aspect I have proposed.

It is a personalization feature that could also make it easier to use for people with some kind of disability or immobility in their hands. This is not my case, I simply look for the productivity that involves moving a finger to the ESCAPE key, instead of pressing ALT+F4, because this also makes me stop looking at the program window to press that combination key.

Last edited by Elektro (2024-09-29 19:32)

Offline

#3 2024-10-04 19:18

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,433

Re: [REQUEST] Capability to edit shortcut key ALT+F4 (accelerator table?)

The ability to customize application's shortcut keys is a nice feature to have, so it has a spot on the feature to-do list. Thanks for a nice GUI demo, I'm sure it will come handy when the day comes to design the shortcut editor.

In relation to the editing of shortcut keys via resource hacking - it should be possible already. Navigate to RCData section, TForm_Main resource, find the MenuItem_Exit object, it should look like this:

object MenuItem_Exit: TMenuItem
  Caption = 'Exit'
  ShortCut = 32883
  OnClick = MenuItem_ExitClick
end

The ShortCut property holds the encoded shortcut key combination. The encoded value is generated via the KeyToShortCut function in Lazarus. The value for ESC key is 27, and for ALT+F4 combination is 32883.

Give it a go and let us know if it works.

Offline

#4 2024-10-05 07:29

Elektro
Senior Member
Registered: 2014-05-28
Posts: 76

Re: [REQUEST] Capability to edit shortcut key ALT+F4 (accelerator table?)

den4b wrote:

Give it a go and let us know if it works.

It works, thank you!!

Offline

Board footer

Powered by FluxBB