CEA - Custom Event Actions

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

Re: CAE_LocationChange, pleeeeease...

Post by admin »

PS: One $i = 0; was missing in your code. The second round *always* takes 1281 msecs here, very unusual for Windows! The first round varies a bit, but is always faster. I'm really surprised. :shock:

I can confirm those results.

Code: Select all

$start = now("msecs");
    while($i++ < 10000) {
        if ("path_x" LikeI <curpath>) {
        }
    }
    text 'Time <curpath>: ' . now("msecs") - $start . " msecs";
    // Result = ~ 1234 msecs
    
    $current = <curpath>;
    $start = now("msecs");
    $i = 0;
    while($i++ < 10000) {
        if ("path_x" LikeI $current) {
        }
    }
    text 'Time $current: ' . now("msecs") - $start . " msecs";
    // Result = 1281 msecs

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

Re: CAE_LocationChange, pleeeeease...

Post by highend »

The code snippets weren't in the same script. I've run them separately and only for showing what I measured I've pasted them here together as one and you're right, in this case the $i = 0; was indeed missing.
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: CAE_LocationChange, pleeeeease...

Post by klownboy »

Don, are you sure you wanted to call the new CEA tweaks CEA_OnBrowseScript and CEA_OnBrowseScript_Script? It doesn't really fit with the terminology of the other CEAs (i.e., the word script in both). Maybe just CEA_OnBrowse and CEA_OnBrowse_Script.

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

Re: CAE_LocationChange, pleeeeease...

Post by admin »

Yes, because contrary to the other ones these are only about scripts.

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: CAE_LocationChange, pleeeeease...

Post by klownboy »

Well OK, but it still would have been fine the other way and more consistent with the other CEAs. :)

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

Re: CAE_LocationChange, pleeeeease...

Post by admin »

Well, okay, can save some bytes... next beta... :)

jupe
Posts: 3292
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: CEA_LocationChange, pleeeeease...

Post by jupe »

This is a game changer. :appl:

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

Re: CAE_LocationChange, pleeeeease...

Post by admin »

I guess it's time to lift the CEA configuration to UI...

FYI, this is when it started (still as "OEA" then). I meditated for 12 years, LOL:

Code: Select all

v7.70.0007 - 2008-10-24 17:40
    + Implemented the first "On Event Action" (OEA), but for now only as 
      a tweak (still meditating about the interface).
        [Settings]
        OEA_ListRightClickOnWhite=0
      The event is "right-click on the list's white space", and you can 
      currently choose between the following actions:
        0 = Popup the Edit menu (as has been before all the time)
        1 = Popup the Shell menu for the current folder
        2 = Do nothing

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

Re: CAE_LocationChange, pleeeeease...

Post by highend »

Code: Select all

    $actions = <<<>>>
        R:\Pictures|#308
        D:\Users\%USERNAME%\Contacts|load "@test.xys";
    >>>;
    $actions = regexreplace($actions, "^[ \t]+");

    $newpath = <newpath>;
    foreach($item, $actions, <crlf>, "e") {
        $path = trim(gettoken($item, 1, "|"), "\", "R");
        $cmd  = gettoken($item, 2, "|", "t", 2);

        if ($path LikeI $newpath) {
            load $cmd, , "s";
            break;
        }
    }

    // Additional scripts that should always be loaded regardless
    // if <curpath> was found in $actions
    load "Show git branch name in tab.xys";
With a short demo of the load script at the end and the first entry of $actions...
GIF 01.12.2020 10-19-40.gif
GIF 01.12.2020 10-19-40.gif (314.53 KiB) Viewed 2238 times
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: CAE_LocationChange, pleeeeease...

Post by klownboy »

Concerning your raising of CEAs to the GUI, great news! I immediately tested that assigning a variable to a script (e.g., perm $ListDoubleClickOnWhite=WhiteSpaceDoubleClickMenu with an XYplorer.ini key value is CEA_ListDoubleClickOnWhite_Script=load $ListDoubleClickOnWhite) thankfully still works. It's nice to be able to change the script assigned to a double click or right click and more importantly be able to change it on the fly. Simply changing the script referred to as the variable.

By the way, why call it "double click on empty", why not stick with "dbl-click on white (or white space)". I think most people will recognize that quicker than empty and it's in sync with the ini keys.

Thanks. :tup:

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

Re: CAE_LocationChange, pleeeeease...

Post by admin »

klownboy wrote: 01 Dec 2020 19:58 By the way, why call it "double click on empty", why not stick with "dbl-click on white (or white space)". I think most people will recognize that quicker than empty and it's in sync with the ini keys.
If you say so, alright. I guess I was thinking of dark mode and shied away from "white"...

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

Re: CAE_LocationChange, pleeeeease...

Post by admin »

BTW, this setting can completely go away now, right?

Configuration | General | Menus, Mouse, Usability | Mouse | Double-click on empty space goes up

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

Re: CAE_LocationChange, pleeeeease...

Post by highend »

BTW, this setting can completely go away now, right?
I see no reason why it should be kept
One of my scripts helped you out? Please donate via Paypal

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

Re: CEA_LocationChange, pleeeeease...

Post by admin »

And instead of "Default" the first entry in the "On dbl-click on empty in folder tree/file list" combo should be "Nothing".

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: CAE_LocationChange, pleeeeease...

Post by klownboy »

admin wrote: 01 Dec 2020 20:55 And instead of "Default" the first entry in the "On dbl-click on empty in folder tree/file list" combo should be "Nothing".
Makes sense.

As far as the white space or empty, either way is fine. I just thought users, even those in dark mode, may key in on white space quicker than empty but maybe not - that may be a just me since I'm so used to on white.

When you end up transferring all the CEA tweaks to the GUI would you end up having a drop down list for the CEA's themselves as well as the current actions and scripts... or list continue to list them separately?

Post Reply