-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Apr 29, 2006 at 06:42:39PM +0200, Anselm R. Garbe wrote:
> Nah, that is somewhat over-engineered to my taste as a default ;)
> Though thanks anyway.
- ---end quoted text---

and what do you think about this function?
- --
        unset KEYS ACTIONS
        function bind_key(){
                        KEYS[$(([EMAIL PROTECTED]))]="$1"
                        ACTIONS[$(([EMAIL PROTECTED]))]="$2"
        }
- --

it is very simple to bind keys 
- --
        M=$MODKEY
        C=Control
        bind_key $C-Return      'aterm &'
        .....
        bind_key $M-d           'xw /view/sel/mode default'
        bind_key $M-s           'xw /view/sel/mode stack'
        bind_key $M-m           'xw /view/sel/mode max'
- --

then, you can easily define active hotkeys with 
- --
        for i in "[EMAIL PROTECTED]"; do echo "$i"; done | wmiir write /def/keys
- --    

process hotkey events with 
- --
        # in event loop
        case "$type" in
                .......
                Key)
                        for i in `seq 0 [EMAIL PROTECTED]; do
                                [ "$1" = "${KEYS[$i]}"  ] && eval 
"${ACTIONS[$i]}"
                        done
                ;;
                .......
        esac
- --    

I think, this is better, then necessity to maintain two separate list of 
buttons and actions in two different places in wmiirc.
-----BEGIN PGP SIGNATURE-----

iD8DBQFEU7QHXdMH9oLAFG8RAkwoAKCXVTxwB4m2N3xL3xlTNJhMkMJVeQCgzeR3
x+a9ljbke01lapwInxywPqQ=
=JhlA
-----END PGP SIGNATURE-----

_______________________________________________
[email protected] mailing list
http://wmii.de/cgi-bin/mailman/listinfo/wmii

Reply via email to