Author Topic: Problem using ESC in keyboard shotcuts (Slickedit 12.0.2 on Linux)  (Read 6942 times)

skilleter

  • Community Member
  • Posts: 14
  • Hero Points: 0
Hi folks,

I'm having an odd problem with binding keys and I hope someone can shed some light on this, because I'm a bit puzzled.

Being an ex-occaisional-emacs user, I decided to bind a number of lesser-used commands in Slickedit to escape-key-prefixed key sequences, (for instance 'ESC k' to invoke the key binding dialogue), so I deleted the existing binding of the ESC key to cmdline_toggle and defined about 20 different commands, all comprising ESC followed by a single key.

These all worked fine until I added an ESC-sequence that was bound in C/C++ mode only. Once I'd done this, this is the only ESC key sequence that works in C/C++ mode - all the others work in all other modes (that I've tried) but not in C/C++ mode, where they result in an 'undefined key' error.

I can think of a way around this, which is to define a macro that checks if the current mode is C/C++ mode (how do you do this in a macro?) then executes the command I wish to to bind only if it is, then bind this macro to the ESC key sequence I want to use, but this seems rather cumbersome and I don't see why it is necessary.

Any ideas?

John Skilleter

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Problem using ESC in keyboard shotcuts (Slickedit 12.0.2 on Linux)
« Reply #1 on: November 16, 2007, 01:58:04 PM »
I'm not sure but maybe you need to do that manually if you don't want to do all the bindings again for C/C++ mode.
Have a look at your VSLICKCONFIG/'vusrdefs.e' file. It contains your keybindings as Slick-C code.
Add the missing 'ESC-' bindings already defined for 'defeventtab default_keys;' also to 'defeventtab c_keys;'
and (save it and) type 'vusrdefs' (it's a Slick-C batch macro module) on cmdline.
Hope it works,
HS2

skilleter

  • Community Member
  • Posts: 14
  • Hero Points: 0
Re: Problem using ESC in keyboard shotcuts (Slickedit 12.0.2 on Linux)
« Reply #2 on: November 16, 2007, 02:44:55 PM »
Thanks for the help, that works OK (although the file is vunxdefs.e under Linux) but it is a bit of a kludge, and I'll have to remember to do it whenever I change keybindings beginning with ESC.

Regards

John