Home Download Buy Blog Forum Support

Issue with keybindings

Issue with keybindings

Postby blot on Mon Feb 20, 2012 4:29 pm

Hi, I'm experiencing some problems with keybindings.

The first problem has to do with 'input shadowing':
Code: Select all
{ "keys": ["ctrl+k"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+k", "ctrl+u"], "command": "upper_case" },

With this setup I'm unable to use the upper_case command, because as soon as I input ctrl+k the toggle_comment command will execute and mute any further inputs to trigger upper_case.


The second problem has to do with the parsing of .sublime-keybinding files:
Code: Select all
{ "keys": ["ctrl+k", "ctrl+u"], "command": "upper_case" },
{ "keys": ["ctrl+k, ctrl+u"], "command": "upper_case" },

The first example is what's shipped with Default (Windows).sublime-keybinding file, it works for an acquaintance (who's using the same build) but not for me.
The second example works on for me though (but the first ctrl+k input will run toggle_command and then upper_case).


Any ideas or pro tips would be appreciated :mrgreen:

I'm using Sublime Text 2 build 2165 portable version.
blot
 
Posts: 7
Joined: Fri Feb 10, 2012 10:38 am

Re: Issue with keybindings

Postby agibsonsw on Mon Feb 20, 2012 5:09 pm

I notice that the key bindings don't have anything assigned to Ctrl-K, presumably because of the issue you mention. Would not changing Ctrl-K (for toggle_comment) to some other combination solve the problem?
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Issue with keybindings

Postby facelessuser on Mon Feb 20, 2012 5:29 pm

1. Once a key is assigned to an actual command, it cannot be used as the sequence initiator (this is just what I am going to call it). So if you want "ctrl+k" to be be used in conjunction with "ctrl+u", "ctrl+k" can never be used as a key trigger by itself, it must always be paired as a sequence initiator.

2. I am not entirely sure. I don't know if issue 1 is interfering with issue 2 or not. As I understand, the keys item is always an array of strings; where each string is a single modifier+key combination. I was under the impression that "ctrl+k, ctrl+u" would not work and is bad form.
facelessuser
 
Posts: 1576
Joined: Tue Apr 05, 2011 7:38 pm

Re: Issue with keybindings

Postby jps on Tue Feb 21, 2012 12:29 am

["ctrl+k, ctrl+u"] is invalid, and will not work. You must use ["ctrl+k", "ctrl+u"].
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: Issue with keybindings

Postby blot on Sat Mar 24, 2012 3:29 am

Makes sense, thanks facelessuser.
blot
 
Posts: 7
Joined: Fri Feb 10, 2012 10:38 am


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 17 guests