Synchronize Directories: no confimation for Permanent delete if to press Shift+Enter on "Delete..." context menu items

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Synchronize Directories: no confimation for Permanent delete if to press Shift+Enter on "Delete..." context menu items

Post by *DrShark »

To reproduce:
1. Compare some locations in Sync Dirs, selet some items.
2. Call the context menu.
3. In context menu, with keyboard select "<- Delete left", "-> Delete right" or "Delete on both sides" item.
4. Press Shift+Enter: the files will be deleted permanently without a chance to cancel the action in "Confirm delete" dialog.

I'm not sure that this is intentinal, looks more like it's a part of Windows behavior.
Still the beahvior it is not expected, so even if it's impossible to make "Confirm delete" dialog apppear properly in this case, I suggest to detect if
the Shift was pressed while one of the "Delete ..." items was pressed with keyboard in the context menu,
and when delete process starts, show in delete progress dialog a 1 or 2 seconds delay so user could cancel an operation by pressing Esc key or "Cancel" button.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3854
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: Synchronize Directories: no confimation for Permanent delete if to press Shift+Enter on "Delete..." context menu ite

Post by *sqa_wizard »

Have a look at your settings (Configuration - Options - Operation - Copy/Delete).
Do you have enabled [x] Use Explorer delete method ?

In this case the deletion is done under the control of Windows explorer.
May it helps to enable the option to show deletion dialog at Recycle Bin settings.
#5767 Personal license
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Synchronize Directories: no confimation for Permanent delete if to press Shift+Enter on "Delete..." context menu ite

Post by *DrShark »

sqa_wizard wrote: 2021-06-26, 14:58 UTC Have a look at your settings (Configuration - Options - Operation - Copy/Delete).
Do you have enabled [x] Use Explorer delete method ?

In this case the deletion is done under the control of Windows explorer.
This option is disabled. If I use the touch pad or mouse buttons to click e.g. "-> Delete right" context menu item while Shift key is pressed, I get a confirmation dialog from TC like this one:

Code: Select all

---------------------------
Confirm delete
---------------------------
RIGHT: Do you really want to delete the 3 selected files/directories?
---------------------------
Yes   No   
---------------------------
If I use Enter key on keyboard instead of mouse or touchpad button, delete process starts immediately (it looks like that confirmation dialog actually appears, but Yes button there is immediately auto-clicked in this case).
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3854
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: Synchronize Directories: no confimation for Permanent delete if to press Shift+Enter on "Delete..." context menu ite

Post by *sqa_wizard »

I can confirm now the special behaviour.

1. Open context menu with mouse on an entry to synchronize
2. move cursor at this context menu to entry "-> Delete right"
3. Press SHIFT-ENTER key
=> a dialog (most likely confirmation) flashes for a 10th of a second
=> file is deleted without a chance to confirm

Seems the confirmation dialog is eating the same ENTER key ;-)
#5767 Personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Synchronize Directories: no confimation for Permanent delete if to press Shift+Enter on "Delete..." context menu ite

Post by *ghisler(Author) »

EDIT: I wasn't able to reproduce the problem when I pressed Shift+Enter normally.
The only way to reproduce it was to press and hold Enter. Then the keyboard would repeat the Enter key until "Yes" the confirmation dialog is pressed too.

I tried with and without the option "Use Explorer delete method".

Could you give me more information, please?
- Total Commander 32-bit or 64-bit?
- Windows version?
- Windows 32-bit or 64-bit?
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Synchronize Directories: no confimation for Permanent delete if to press Shift+Enter on "Delete..." context menu ite

Post by *DrShark »

In a summer, 2021 I tested the partial fix of this issue in what was then private beta of TC 10.10 pre 3:
history1050.txt wrote:30.06.21 Fixed: Synchronize dirs: Make sure the Enter key is not pressed any more when deleting files on the left/right via context menu before showing the confirmation dialog (not reproduced bug) (32/64)
With the fix it's better but sometimes I can still reproduce the problem.

Christian Ghisler's guess it that that problem could be with key bouncing:
Christian Ghisler (by email) wrote:that could be a key sending two events (key bouncing effect).
TC waits for Enter being released before showing the delete confirmation
now. But if the key bounces, Windows will send two keypressed/rel[e]ased
events.
And if this is the case, TC cannot wait:
Christian Ghisler (by email) wrote:At least for the keyboard repeat delay. That's the time the keyboard waits
after pressing and holding a key until it starts sending repeated keys.
[...]
The delay is what you configure in the control panel.
[...]
I wrote then that I dout it's a key bouncing problem (if by it was meant that option which allows Windows to ignore repeated keypresses
and which can be turned on with the dialog which appears if to hold the Shift key for 8 seconds), because on the video I sent by email, the possible double Enter was sent to the confirmation dialog immediately after context menu was closed, and there wasn't seem to be any noticeable delay between the repeated Enter keypresses that dialog received...

I wrote that it usually happens if to press Shift+Enter very fast, so like together, so it's possible to hit Enter at first, and asked to try to press Enter+Shift on delete item in context menu: the Enter will be send to the Confirmation dialog and files will be permanently deleted. Maybe that is a problem.

The goal of bugfix is to prevent unexpected deletion of files when user sends the Enter key to a context menu, but it goes to a confirmation dialog. As I see it, TC has to watch for that keyboard repeat delay since context menu shows up and a bit (a second or even less?) after context menu has been closed and confirmation dialog appeared - to prevent pressing Yes there by accident, whether it happens due to key bouncing effect or not...

The last reply on this I got from Christian Gisler is:
Christian Ghisler (by email) wrote:[and] So far i couldn't reproduce the error any more after my fix. :(
It would be nice if someone could help to figure out with reproducing of the issue and finding a solution.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Synchronize Directories: no confimation for Permanent delete if to press Shift+Enter on "Delete..." context menu ite

Post by *ghisler(Author) »

Sorry, I don't have any better solution. Try using the Enter instead of the Return key (or vice versa) to check if that key also causes the same effect. If not, then your Return key is defective.
Author of Total Commander
https://www.ghisler.com
mk-will
Junior Member
Junior Member
Posts: 10
Joined: 2014-01-20, 08:55 UTC

Re: Synchronize Directories: no confimation for Permanent delete if to press Shift+Enter on "Delete..." context menu ite

Post by *mk-will »

I wasn't able to reproduce the problem (tc 10.00 and 10.50 rc1, 32- and 64-bit, Win10 21H1), regardless of the used combination of keys (shift, enter, return).
So I would assume that this is hardware related.

Actually, when the confirmation dialog comes up, the focus is set to the YES button.
Changing the focus to the NO button would prevent the accidentally deletion.
Post Reply