Sublime text keyboard shortcut binding not functioning

Following the instructions here, I've set up a new installation of SublimeText for use with R. I have no other SublimeText plug-ins installed. The keyboard shortcuts that are setup using the instructions in the link above don't work. I've set up my user key binding file as specified in the tutorial.

There are no conflicting key bindings in the 'Default' key bindings file.

Nonetheless, I can execute my R code in REPL by clicking through the menus:

Tools > SublimeREPL > Eval in REPL > Selection (Ctrl+Shift+R)

If I actually press the Ctrl+Shift+R shortcut, nothing happens.

Here's a copy of my user key binding file:

[
// Modified Sublime-REPL keybindings for an "R-friendly" set of shortcuts.
// For more information, see http://tomschenkjr.net/2012/05/17/using-sublime-text-2-for-r/

// Executes a selection of text in REPL, latter only displays code and does not execute
{ "keys": ["ctrl+shift+r"], "command": "repl_transfer_current", "args": {"scope": "selection"}},
{ "keys": ["ctrl+shift+r", "r"], "command": "repl_transfer_current", "args": {"scope": "selection", "action":"view_write"}},

// Executes the entire file (build) in REPL, latter only displays code and does not execute
{ "keys": ["ctrl + f7"], "command": "repl_transfer_current", "args": {"scope": "file"}},
{ "keys": ["ctrl + f7", "r"], "command": "repl_transfer_current", "args": {"scope": "file", "action":"view_write"}},

// Executes line(s) of text in REPL terminal, latter only displays code and does not execute
{ "keys": ["ctrl+alt+r"], "command": "repl_transfer_current", "args": {"scope": "lines"}},
{ "keys": ["ctrl+alt+r", "r"], "command": "repl_transfer_current", "args": {"scope": "lines", "action":"view_write"}},

// Executes a block (e.g., a custom function) of text in REPL terminal, latter only displays code and does not execute
{ "keys": ["ctrl+shift+alt+r"], "command": "repl_transfer_current", "args": {"scope": "block"}},
{ "keys": ["ctrl+shift+alt+r", "r"], "command": "repl_transfer_current", "args": {"scope": "block", "action":"view_write"}}

]

What am I doing wrong?


Solution 1:

Thanks to the following comment from OP:

Okay, here's the weird thing; if I press ctrl+shift+CapsLock+R, it works...

I can guess that ["ctrl+shift+r"] waits for a lowercase r, however, when you've pressed shift (which is a part of the shortcut key combination), it reads an uppercase R.

When OP has turned his CapsLock on, pressing r would have normally outputted R, but while SHIFT key is pressed, it reads lowercase r.

This probably happens because Sublime tries to read the exact same character, rather than the key code of the pressed button.

And thus, the solution should be using the opposite case letter when in a key combination including SHIFT (using R instead of r in this case):

// Executes a selection of text in REPL, latter only displays code and does not execute
{ "keys": ["ctrl+shift+R"], "command": "repl_transfer_current", "args": {"scope": "selection"}},
{ "keys": ["ctrl+shift+R", "r"], "command": "repl_transfer_current", "args": {"scope": "selection", "action":"view_write"}},