in reply to Extend PCE with your own hotkeys

thanks for interest. i am very delighted to read your first sentences. your always welcome for developement but unless you don't submit in cvs its your hack. conigurable key map was from the perl coders i talked with here one of the most wanted and often i drive developement toward desired features. the problem is only that current keybinding are autogenerated. after 0.3.4 or 5 we will have full controll over it and you will get your desired features ASAP. with your help maybe sooner. have joy

Replies are listed 'Best First'.
Re^2: Extend PCE with your own hotkeys
by Corion (Patriarch) on Oct 24, 2005 at 14:09 UTC

    Currently, I'm thinking of an easy hack in the event.pm file:

    use vars qw(%keybinding); %keybinding = ( ... default keybinding ); my @user_bindings = do 'user_keybinding.pl'; while (@user_bindings) { my ($k,$v) = splice @user_bindings, 0, 2; $keybinding{$k} = $v; }; sub key_down_filter { my ($sci_frame, $event) = @_; my $key = $event->GetKeyCode; if ($event->AltDown) { $key = "a$key"; }; # same for shift, ctrl, meta, footpad, escape if (exists $keybinding{$key}) { # dispatch $keybinding{$key}->($sci_frame,$event,$key); }; };

    Update: I should add that using this scheme, it's not really easy to do multi-key combinations a la WordStar or vi - to implement these, multiple dispatch tables are needed. But as a first start I think this kind of keybinding will be enough.