Author Topic: Key-mappings in list-buffers window on OSX  (Read 3442 times)

potassiumchloride

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Key-mappings in list-buffers window on OSX
« on: October 09, 2007, 08:14:14 pm »
Hi. Long-LONG-time vse user here, but new user of VSE on Mac OSX.

I've succeeded in getting Ctrl-P to map to "cursor-up", and Ctrl-N to "cursor-down", in fundamental (a.k.a. default) mode, but when ever I bring up the list-buffers window (mapped to Ctrl-XB), Ctrl-P simply jumps to the beginning of the list, and Ctrl-N to the end.

How do I get Ctrl-P/Ctrl-N to behave in the list-buffers window the same way it works in every other context?

TIA,
         -k

hs2

  • Senior Community Member
  • Posts: 2744
  • Hero Points: 288
Re: Key-mappings in list-buffers window on OSX
« Reply #1 on: October 09, 2007, 08:56:05 pm »
Currently 'C-P' is mapped to 'PG-UP' and 'C-N to 'PG-DN' and 'C-K' to 'down', 'C-I' to 'up'.
You could patch 'tbfilelist.e' directly and loose your changes / need to re-patch it on next upgrade or maybe hotfix affecting this module.
Here: tbfilelist.e - ctl_filter.up,"c-i"() [line 1196 ff.]:

Or you add this to your own macro module (e.g. vusrmacs.e) to override the default event handler acc. to your needs. You only need to reload your module on next upgrade.

Code: [Select]
#include 'slick.sh'

defeventtab _tbfilelist_form;
// also redirect list events to filter event handler
void ctl_file_list.'C-N','C-P'()
{
   ctl_filter.call_event (ctl_filter,last_event (),'W');
}
void ctl_filter.'C-N','C-P'()
{
   key := upcase ( event2name (last_event(null, true)) );
   ctl_filter.call_event (ctl_filter, ( ( key :== 'C-N' ) ? C_K : C_I ),'W');
}

But note that 'C-P' / 'C-N' are mapped to 'PG-UP' / 'PG-DN' and 'C-I'/'C-K' to 'up'/'down' by default in all tree controls !
If you want to change the default behaviour of all tree controls you could use this in addition (or patch treeview.e):
Code: [Select]
defeventtab _ul2_tree;
void _ul2_tree.'C-P'()
{
   call_event (p_window_id,up,'2');
}
void _ul2_tree.'C-N'()
{
   call_event (p_window_id,down,'2');
}

// in addition to normal page-up/down
void _ul2_tree.'C-I'()
{
   call_event (p_window_id,PGUP,'2');
}
void _ul2_tree.'C-K'()
{
   call_event (p_window_id,PGDN,'2');
}

Have fun,
HS2
« Last Edit: October 09, 2007, 09:26:20 pm by hs2 »

potassiumchloride

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Re: Key-mappings in list-buffers window on OSX
« Reply #2 on: October 10, 2007, 03:20:48 pm »
Thanks, HS2! This works exactly as advertised.

But, I am a little dismayed that it takes this deep a fix to change such a close-to-the-user UI behavior. At VSE 8.0 on Windows, the key-mapping for the file list-box seems to be inherited from that set for "fundamental", which I would argue is the correct thing to do. Having a often-used and easy to invoke sub-window change the meaning of basic navigation keys relative to the main edit window is user-hostile, IMHO. If someone from Slickedit is monitoring this thread, please pass this along to your GUI dude or dude-ess as a constructive suggestion!  :)

         -kcl

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: Key-mappings in list-buffers window on OSX
« Reply #3 on: October 11, 2007, 01:57:22 pm »
Change request filed!