I am running the latest versions of: Arch, nvim, and the Openbox window manager.

I often don't know whether I have actually hit the escape key or not, when exiting another mode to normal mode. If I miss the escape key when I thought I hit it, it takes me a few moments to sort the confusion out. Frustrating.
Something I'm sure many of us are familiar with.

So in the Openbox keybinding file rc.xml I have created a keybinding that plays an audio file "escape.mp3" which says the single word "escape" whenever I hit the escape key. Gives audio confirmation. On the face of it seems fine, just have to see how I feel about this going forward.
(May be one of those great ideas that turns out to be useless. Just have to see)

Getting the audio to play using the command line audio player mpg123 when I hit escape works just fine.

However making this keybinding mapping to the audio file in Openbox has caused the esc key to stop escaping to normal mode in vim.

Inside .vimrc the only thing mapped directly to esc is jj.
CTRL+c works as esc too, obviously.

Ideas for what is at issue here, so I can get it to perform both.

My Openbox 'rc.xml' key binding:

<keybind key="0x9">  
   <action name="Execute">  
     <command>bash -c 'mpg123 ~/escape.mp3 &#38;'</command>    
  • 3
    Are you sure that this is a vim issue and not an openbox configuration issue? You may have replaced what <kbd>Esc</kbd> does rather than added to it perhaps. Apr 3 '21 at 9:41
  • I agree, I feel however it's marginally vim as there is a potentially beneficial aspect to the user interface. You're spot on with the it being more Openbox on the interface side, yes. That's certian. But it's more a vim issue on the user side. Vim users are often discussing keys and how better use them, eg swapping caps lock and esc keys. So I put it here. But yes, it's certianly debatable.
    – Kes
    Apr 3 '21 at 10:06
  • 1
    Whilst I don’t disagree that the effect may be vim-related, you may get more purchase on the cause of the issue on the main SE site with the openbox tag. Apr 3 '21 at 10:16
  • 1
    Also, in case you aren’t aware and apologies if you are, CTRL-[ will send Esc in case that helps your overall aim. Apr 3 '21 at 10:19
  • @Andrew-Ho-Lee thanks. Since the post is here I'd better leave it a while before trying something else. Your <kbd>Esc</kbd> idea did momentarily flash through my head earliear. I've used it to add xdotool key "escape" to create a fake key press, but I think I need to figure out how to get it to the right display, etc
    – Kes
    Apr 3 '21 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.