nkh / P5-App-Asciio

Plain ASCII diagram
https://nkh.github.io/P5-App-Asciio/
51 stars 4 forks source link

Accept multiple escape binding fro action groups #171

Closed nkh closed 7 months ago

nkh commented 7 months ago

Binding Groups


'<< selection leader >>' =>
    {
    SHORTCUTS   => '000-r',                                        # accepts multiple entries in an array ref
    ENTER_GROUP => \&App::Asciio::Actions::Selection::selection_enter,
    ESCAPE_KEYS => [ '000-r', '000-Escape' ],           # accepts single entry

        # ESCAPE_KEYS need to be define of group will catch input untill an action is selected 

        # same keys as the ESCAPE_KEYS, will be called on exit
    'Selection escape'               => [ '000-r',             \&App::Asciio::Actions::Selection::selection_escape                      ],
    'Selection escape2'              => [ '000-Escape',        \&App::Asciio::Actions::Selection::selection_escape                      ],

        # simple command
    'select flip mode'               => [ '000-f',             \&App::Asciio::Actions::Selection::selection_mode_flip                   ],

        # handle mouse movement
    'select motion'                  => [ '000-motion_notify', \&App::Asciio::Actions::Selection::select_elements                       ],
    },
nkh commented 7 months ago

c431260

@qindapao this fixes binding the same key to enter and escape a group.

I also refactored the whole Actions.pm and integrated the selection mode.

As you can see in the example above we can:

qindapao commented 7 months ago

@nkh

Ok, I like it very much.