Sublime Forum

Key binding assigned to "Cancel Build" not working

#1

Hi All,
I tried adding this:

{ "keys": "ctrl+alt+c"], "command": "cancel_build" }

No joy. Does anyone know what the command should be? I’ve made sure ctrl-alt-c isn’t clashing with anything else (I’ve also tried other key combinations).

Thanks

1 Like

#2

Open the console and type:

sublime.log_commands(True)
sublime.log_input(True)

This should give some indication to whether the binding is working at all and if it is, which command it’s routed to.

0 Likes

#3

The command isn’t cancel_build: take a look through Packages/Default/Main.sublime-menu to find the commands behind each of the menu items

0 Likes

#4

Seems the default binding is this: { “keys”: “ctrl+break”], “command”: “exec”, “args”: {“kill”: true} }

0 Likes

#5

Magic!

Changed to:

{ "keys": "ctrl+alt+c"], "command": "exec", "args": {"kill": true} }

and it works great.

Can’t confirm Ctrl-Break works - on a Macbook keyboard.

Thanks lots for your help.

0 Likes

#6

Don’t forget your square brackets. The correct command should be:

{ "keys": ["ctrl+break"], "command": "exec", "args": {"kill": true} }

by the way, ctrl+break is just an example of the key bindings you can use. You can also do ctrl+end, which is my favorite use case or something you are more familiar with.

1 Like

#7

Thank you @riazb and @blairg23 I tried both answers and they worked like a charm. Many many thanks

0 Likes

#8

Glad to hear it, @morogoyo ! Side note: I use ctrl+break on Windows since ctrl+c (the typical process kill keyboard shortcut) is COPY, but on Mac keyboard, I use ctrl+c since cmd+c is COPY.

0 Likes

#9

My default was: { “keys”: [“ctrl+break”], “command”: “cancel_build” } but it didn’t work and nothing showed next to Tools -> Cancel Build in the menu.

Changed by User prefs to: { “keys”: [“ctrl+pause”], “command”: “cancel_build” } and now works thanks to helpful guidance in this thread. (Pause/Break key is seen as ‘pause’)

(Using ST3 on Ubuntu 14.04)

2 Likes

#10

It is seen as pause here too, but changing it to ctrl+pause does not fix it. I changed it to just pause.

0 Likes

#11

What is going on with this command?
My default is shown as { "keys": ["ctrl+break"], "command": "cancel_build" },
This works for me, or more specifically C+Fn+PgUp works for me.
I tried ctrl+shift+c I have it set as { "keys": ["f11"], "command": "cancel_build" } right now. I tried the start of my keymap file, I tried the end of my keymap file. Nothing works.

The only thing I accomplished is f11 no longer fullscreens the app. So my f11 key works, and cancel_build works, but I do not seem to be able to customize this particular function.

Here is my keymap file
[
{ “keys”: [“f11”], “command”: “cancel_build” },
{ “keys”: [“f12”], “command”: “reindent”, “args”: {“single_line”: false}}
]

I must be making some stupid mistake, but I feel like I have checked everything that could by wrong on my end multiple times in multiple ways.

0 Likes