Sublime Forum

Escape Key Stopped Working

#1

My escape key isn’t properly closing dialogs like the find box (cmd-f) or the go to file box (cmd-P).

A reboot sometimes fixes it – temporarily. A reinstall fixed it - temporarily. I’m not sure what’s going on or why, and it’s really quite annoying.

I’m clueless on how to debug this. I may have accidentally pressed a keyboard shortcut of some short shortly before this started happening – accidentally mashed some keys while holding cmd to use a known shortcut, though I really have no clue which ones they were or what could cause this.

0 Likes

#2

You can diagnose issues like this by opening the Sublime console with View > Show Console and then entering sublime.log_commands(True) and sublime.log_input(True) to enable logging. Once you do that, every key you press will get logged, and every command executed will similarly also get logged.

With the logging enabled you can take an action where the key isn’t working and then check the console to see if the log captures the key correctly and/or if it appears to be executing the correct command or not. Seeing the wrong key (or no key) is an indication of a keyboard layout problem, while seeing the correct key but the wrong command is an indication that some plugin has taken over the key.

There’s more information on this available in this video on diagnosing key binding problems as well, should you want a little more detail.

0 Likes

#3

No key – it’s not showing the press of the escape key at all. Will go through the video, thanks for hte help.

0 Likes

#4

Ugh. Complete PEBKAC error.

Turns out the app that I’m actively writing is doing it. I thought I wrote it to capture ‘esc’ key presses when the window is focused, but it’s actually catching them whenever the app is running.

Ugh.

0 Likes