CTRL+SHIFT+P shortcut causes an action, but it shouldn't

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
AdamFromPl
Junior Member
Junior Member
Posts: 2
Joined: 2024-07-23, 18:26 UTC

CTRL+SHIFT+P shortcut causes an action, but it shouldn't

Post by *AdamFromPl »

Hi

I think it's a minor (cosmetic) issue.

In the official help included with Total Commander (Help -> Keyboard menu item) we can read:
CTRL+P Copy current path to command line

CTRL+P works fine (as documented) but for some reason CTRL+SHIFT+P does exactly the same thing, and this shortcut is not documented anywhere.
I think CTRL+SHIFT+P shouldn't cause any action.

Have a nice day,
Adam
User avatar
petermad
Power Member
Power Member
Posts: 16098
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: CTRL+SHIFT+P shortcut causes an action, but it shouldn't

Post by *petermad »

It is like that for all commands where a shorcut with an additional modifier is not defined. For exampel Ctrl+F3 and Shift+Ctrl+F3 does the same or Crtl+Z and Shift+Ctrl+Z, or Alt+F8 and Shift+Alt+F8 etc. etc.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
AntonyD
Power Member
Power Member
Posts: 1661
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: CTRL+SHIFT+P shortcut causes an action, but it shouldn't

Post by *AntonyD »

This is a very strange logic - to think that adding seemingly unnecessary modifiers does not change anything
in the logic of prog.code for servicing these clicks.
NO - if the Crtl+Z hotkey is specified for some action, no other variations with modifiers SHOULD NOT trigger it!
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: CTRL+SHIFT+P shortcut causes an action, but it shouldn't

Post by *ghisler(Author) »

Sorry but I will NOT change that. There are 100s of hotkeys where I don't check for Shift or other modifiers because it doesn't matter, but some people may be using these hotkeys with Shift.
For example, Alt+F1 and Alt+F2 can't be used on Linux because they are used by the window manager. But Alt+Shift+F1 and Alt+Shift+F2 can.

Moderator message

Moved to will not be changed
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 1661
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: CTRL+SHIFT+P shortcut causes an action, but it shouldn't

Post by *AntonyD »

It’s strange, but when I suddenly take and reinstall the hotkey to SHIFT+ALT+CTRL+Z, the program will suddenly for some reason (it will!) deal with these additional modifiers and understand that by pressing them I still want to get exactly the command that was originally assigned to a simple CTRL+Z.
And how does this then relate to the phrase:
I don't check for Shift or other modifiers
There is either support for parsing modifiers, or there is none at all.
Your explanation doesn't make sense, imho.
#146217 personal license
User avatar
white
Power Member
Power Member
Posts: 5969
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: CTRL+SHIFT+P shortcut causes an action, but it shouldn't

Post by *white »

AntonyD wrote: 2024-08-05, 11:20 UTC And how does this then relate to the phrase:
I don't check for Shift or other modifiers
You're quoting out of context. The quote was:
ghisler(Author) wrote: 2024-08-05, 09:58 UTC There are 100s of hotkeys where I don't check for Shift or other modifiers..
So there are hotkeys where Shift or other modifiers do not matter and there are hotkeys where they do matter. Obviously the more specific hotkeys, where modifiers do matter, are handled first.
User avatar
AntonyD
Power Member
Power Member
Posts: 1661
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: CTRL+SHIFT+P shortcut causes an action, but it shouldn't

Post by *AntonyD »

This is a very strange interpretation of the author's position.
Once again - if we take ONE and THE SAME initial hotkey, then its processing inside the Total code clearly goes through one piece of the prog.code.
And there it is not checked first - WHAT attached command do we want to execute? And like: if suddenly this is a "command A" - and its logic is insignificant and it doesn’t matter what keys we call it with - then we will process the pressed keys in "such" sequence - where the pressed modifiers are ignored. And if suddenly this is an important "command B", then there we will begin parsing the pressed keys immediately + identify all modifiers.
So it will be like in "that" sequence of actions. So you think that this is a normal way of happening?

Well, it turns out to be logical nonsense.
ANY keypresses must go through the same cycle of checking the keys pressed - and be processed IN ENTIRELY.
Those. The commands SHIFT+CTRL+Z and CTRL+Z must be different.
And if nothing is assigned to the SHIFT+CTRL+Z hotkey, then SHOULD NOT perform automatically!
that command which is assigned to the CTRL+Z hotkey - without additional modifier SHIFT.

Due to this logic of supporting the parsing of pressed keys, it may happen that in another place a completely
common hotkey will be able to perform completely unexpected behavior in the current open dialog/window.
And this already leads directly to a bug in the application.
#146217 personal license
JOUBE
Power Member
Power Member
Posts: 1685
Joined: 2004-07-08, 08:58 UTC

Re: CTRL+SHIFT+P shortcut causes an action, but it shouldn't

Post by *JOUBE »

ghisler(Author) wrote: 2024-08-05, 09:58 UTC Sorry but I will NOT change that.

Moved to will not be changed
Thanks. No waste of time for something like that.
User avatar
white
Power Member
Power Member
Posts: 5969
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: CTRL+SHIFT+P shortcut causes an action, but it shouldn't

Post by *white »

AntonyD wrote: 2024-08-05, 13:16 UTC Once again - if we take ONE and THE SAME initial hotkey, then its processing inside the Total code clearly goes through one piece of the prog.code.
When more specific hotkeys, which include additional modifier key(s), are handled first, before the processing of "global hotkeys" that disregard additional modifier keys being pressed, the code for the global hotkey is never reached if a more specific hotkey is defined and being pressed.
User avatar
AntonyD
Power Member
Power Member
Posts: 1661
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: CTRL+SHIFT+P shortcut causes an action, but it shouldn't

Post by *AntonyD »

Unfortunately, we can only guess what is actually executed in the code and how.
The only reality is that we will never get any other behavior, After all, the author clearly said - he will not redo this moment...
So, if and when I come across repetitions in hotkeys, I will have to take it calmly.
The main thing is that, for example, accidentally pressed ALT+SHIFT+F8 do not work as just F8, for example.
Which, according to the setting, deletes the selected immediately - without the recycle bin.
Otherwise, we can assume that ALT+SHIFT will be discarded as unimportant modifiers.
Or ALT+F4 will start doing something else))) Or SHIFT+ALT+F4 will do the same as ALT+F4 - when I don't want it...
#146217 personal license
Post Reply