Author Topic: Remove text selection by pressing ESC  (Read 123 times)

jcelle

  • Community Member
  • Posts: 41
  • Hero Points: 1
Remove text selection by pressing ESC
« on: November 27, 2017, 01:20:11 pm »
Hello,
Is there a way to have SlickEdit deselect any text selected by pressing the ESC key ?
I mean I don't want to bind the deselect() or deselect-all() function to ESC key because I might lose existing behavior of ESC key.
But I am surprised that by default it does not allow deselecting among its actions.

Any idea ?
Many thanks in advance.

Jerome C.


patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 817
  • Hero Points: 46
Re: Remove text selection by pressing ESC
« Reply #1 on: November 27, 2017, 02:27:53 pm »
There's a setting for that, but you have to set it manually.  In the SlickEdit command line run "set-var def_escape_deselects 1". 

jcelle

  • Community Member
  • Posts: 41
  • Hero Points: 1
Re: Remove text selection by pressing ESC
« Reply #2 on: November 27, 2017, 02:51:49 pm »
Thanks Patrick !
In fact the spelling seems to be def_esc_deselects, which I set to 1, but no change: text is not deslected when I press ESC.
By curiosity I looked at ESC definition : it is bound to cancel-recording.
Would that be normal ?

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 817
  • Hero Points: 46
Re: Remove text selection by pressing ESC
« Reply #3 on: November 27, 2017, 03:48:14 pm »
Hmm, it should only be bound to that if you're recording a macro at the time you checked the bindings.  I haven't heard of the binding getting stuck to that, but if you're not recording a macro, we'd need to look in to that.  For CUA emulation, it's default binding should be cmdline-toggle. 

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4031
  • Hero Points: 267
Re: Remove text selection by pressing ESC
« Reply #4 on: December 03, 2017, 02:40:57 pm »
When you record a macro, the Esc key gets temporarily rebound to "cancel_recording". In that case, you would have to hit it twice (once to cancel the recording and another time to deselect). If your Esc key is bound to cancel_recording when you are not recording a macro, you will need to fix that in the key bindings dialog.

The default binding for Esc is cmdline_toggle for CUA emulation. If you are not in that emulation, this key binding may be different.