✅ Support for parameters when binding commands to hotkeys

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Support for parameters when binding commands to hotkeys

Post by *ghisler(Author) »

It's due to the following change:
14.05.23 Added: Internal commands which do not start with cm_ or em_ now support placeholders like %P%N in internal associations and user-defined hotkeys, e.g. OPENBARMENU (32/64)
That's because I'm treating it like the parameters field in configuration - button bar.
So you need to use %|COMMANDER_PATH| instead of %COMMANDER_PATH%.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: Support for parameters when binding commands to hotkeys

Post by *Fla$her »

ghisler(Author) wrote: 2023-05-18, 07:11 UTC So you need to use %|COMMANDER_PATH| instead of %COMMANDER_PATH%.
I immediately started with %|COMMANDER_PATH|, it doesn't work.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Support for parameters when binding commands to hotkeys

Post by *ghisler(Author) »

I have just tried it here and it worked just fine. Maybe you forgot the backslash behind it?
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: Support for parameters when binding commands to hotkeys

Post by *Fla$her »

No. wincmd.ini:
[ShortcutsWin]
A+G=SAVETABS
A+G_params="%|COMMANDER_PATH|\Tabs\Current.tab"
And what about the missing quotes?
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Support for parameters when binding commands to hotkeys

Post by *petermad »

For some reason this does not work for keyboard remapping when using OPENTABMENU with a Parameter:

Code: Select all

[Shortcuts]
C+W=OPENBARMENU
C+W_params=%|COMMANDER_PATH|\default.bar
does NOT work

neither does:

Code: Select all

[Shortcuts]
C+W=OPENBARMENU
C+W_params=c:\totalcmd\default.bar

Wheras:

Code: Select all

[Shortcuts]
C+W=OPENBAR
C+W_params=%|COMMANDER_PATH|\default.bar
does work


As do:

Code: Select all

[Shortcuts]
C+X=OPENLANGUAGEFILE
C+X_params=%|COMMANDER_PATH|\language\wcmd_deu.lng


If I make an em_command like:

Code: Select all

[em_openbarmenu]
cmd=OPENBARMENU
then:

Code: Select all

[Shortcuts]
C+W=em_openbarmenu
C+W_params=%|COMMANDER_PATH|\default.bar
does NOT work either.

I haven't tried all the other "Commands with parameters" - maybe there are others that do not work.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Support for parameters when binding commands to hotkeys

Post by *ghisler(Author) »

It does not currently work with [ShortcutsWin], just with [Shortcuts]. [ShortcutsWin] only supports parameters for cm_ and em_ commands. I will fix it in beta 4.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Support for parameters when binding commands to hotkeys

Post by *petermad »

2ghisler(Author)
Please read my examples her above again - NONE of them are for [ShortcutsWin] - it is about OPENBARMENU not working with a path in the Parameters field - unlike all the other "Commands with parameters" do.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Support for parameters when binding commands to hotkeys

Post by *ghisler(Author) »

Are you using the 64-bit version? I noticed that OPENBARMENU would shortly open the menu but immediately close it again when invoked via hotkey. Removing all keyboad messages before opening the popup does seem to work, though. I have added that now for beta 4.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Support for parameters when binding commands to hotkeys

Post by *petermad »

ghisler(Author) wrote: 2023-05-19, 13:54 UTC Are you using the 64-bit version? I noticed that OPENBARMENU would shortly open the menu but immediately close it again when invoked via hotkey. Removing all keyboad messages before opening the popup does seem to work, though. I have added that now for beta 4.
Yes I was using 64bit TC

I can confirm that:

Code: Select all

[Shortcuts]
C+W=OPENBARMENU
C+W_params=%|COMMANDER_PATH|\default.bar
works in 32bit TC, and now that you say it I can see a VERY short blink on the screen, where the buttonbar was supposed to open in 64bit TC
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Support for parameters when binding commands to hotkeys

Post by *ghisler(Author) »

Exactly, somehow the remaining key message(s) in the message queue seem to close the menu immediately.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: Support for parameters when binding commands to hotkeys

Post by *Fla$her »

Fla$her wrote: 2023-05-18, 07:54 UTC No. wincmd.ini:
[ShortcutsWin]
A+G=SAVETABS
A+G_params="%|COMMANDER_PATH|\Tabs\Current.tab"
And what about the missing quotes?
TC 11.00b4:

Code: Select all

---------------------------
Total Commander
---------------------------
Function not implemented!

12345678
---------------------------
ОК   
---------------------------
Overquoting is evil! 👎
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3293
Joined: 2003-05-06, 11:46 UTC

Re: Support for parameters when binding commands to hotkeys

Post by *Sir_SiLvA »

on a button only works if "SAVETABS %COMMANDER_PATH%\Tabs\Current2.tab" is in cmdline with proper %Commander_path%.
on shortcut not at all
Hoecker sie sind raus!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Support for parameters when binding commands to hotkeys

Post by *ghisler(Author) »

The following works for me now:
[ShortcutsWin]
C+W=OPENBARMENU
C+W_params=%|COMMANDER_PATH|\default.bar

Can you try it?

I can confirm that SAVETABS doesn't work.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: Support for parameters when binding commands to hotkeys

Post by *Fla$her »

ghisler(Author) wrote: 2023-05-24, 19:54 UTCCan you try it?
Works. See more here.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Support for parameters when binding commands to hotkeys

Post by *petermad »

ghisler(Author) wrote: 2023-05-24, 19:54 UTC The following works for me now:
[ShortcutsWin]
C+W=OPENBARMENU
C+W_params=%|COMMANDER_PATH|\default.bar

Can you try it?

I can confirm that SAVETABS doesn't work.
Yes that works now in 64bit TC 11.00b4 in both [Shortcuts] and [ShortcutsWin]

I also works with quotes:

Code: Select all

C+W=OPENBARMENU
C+W_params="%|COMMANDER_PATH|\default.bar"
Last edited by petermad on 2023-05-24, 23:39 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply