Sublime Forum

Numberpad keys not working with ctrl+shift

#1

Hey all-

I’m new to Sublime, having used TextPad for the last couple decades (yes, I am fairly change-averse!), and am still finding my way around, so I have a few questions/things I’m stuck on.

Right now, I’m setting up the keymap and am having problems getting the keypad keys to work 100% correctly. My goal is to have ctrl+keypad1 (and 2, 3, etc) change the group focus, and then have ctrl+shift+keypad1 (and 2, 3, etc) move the file among groups. The former works great, but the latter does not. Here’s what I’ve got:

{ “keys”: [“ctrl+keypad1”], “command”: “focus_group”, “args”: { “group”: 0 } }
…2, 3, etc…
{ “keys”: [“ctrl+shift+keypad1”], “command”: “move_to_group”, “args”: { “group”: 0 } }
…2, 3, etc…

In the console, pressing ctrl+1 & ctrl+2 gives me:

command: focus_group {"group": 0}
command: focus_group {"group": 1}

but pressing ctrl+shift+1 & ctrl+shift+2 gives me:

command: move_to {"extend": false, "to": "eof"}
command: scroll_lines {"amount": -1.0}

which means it’s registering as “End” and “Down”. Combing through the forum, I saw a couple threads related to this issue, but no solutions. Anyone have any ideas? Thanks!

Chris

0 Likes

#2

I’d suggest enabling input logging with sublime.log_input(True) and see what keys ST is actually receiving. I know some operating systems handle the numpad specially when it comes to modifiers.

0 Likes

#3

Ah, I see what you mean. Here are the results for the four key presses:

ctrl+1: key evt: ctrl+keypad1
ctrl+2: key evt: ctrl+keypad2
ctrl+shift+1: key evt: ctrl+end
key evt: ctrl+shift
ctrl+shift+2: key evt: ctrl+down
key evt: ctrl+shift

So for some reason, ctrl+shift+keypad_number registered as two key events. Yet, oddly, the following worked fine:

key evt: shift+ctrl+keypad_divide
key evt: shift+ctrl+keypad_multiply
key evt: shift+ctrl+keypad_minus
key evt: shift+ctrl+keypad_plus

Anyways, for this problem I just substituted alt for shift, and now the two commands do what I need them to, albeit with a slightly less-comfortable hand position… :slight_smile: Thanks!

Chris

0 Likes