Sublime Forum

Keymapping "gray" (numeric) keypad keys

#1

Hello,
I creating Brief emulation via User keymap and it has special functions attached to “gray” (numeric) keypad keys: *, - and + (different from regular , -, +)
For example gray * == “undo”.
But this keymapping won’t work because it will prevent entering * completely:
{ “keys”: "
"], “command”: “undo” }

So I wonder if Sublime editor somehow allows differentiating between “gray” and normal keys?

Gleb

0 Likes

#2

PS: resolved:

{ “keys”: “keypad_multiply”], “command”: “undo” }
OR:
{ “keys”: “keypad_multiply”], “command”: “soft_undo” }

Gleb

1 Like

#3

A bit OT but for other people looking for ‘keypad_insert’ or ‘keypad_ins’, it’s keypad0 :smile:

1 Like

#4

And here’s a fuller list of the numeric keypad items:

keypad0
keypad1
keypad2
keypad3
keypad4
keypad5
keypad6
keypad7
keypad8
keypad9
keypad_period
keypad_divide
keypad_multiply
keypad_minus
keypad_plus
keypad_enter

HTH - J.

4 Likes

#5

You can also enter sublime.log_input(True) in the console to see which keys are passed through to Sublime.

1 Like

#6

Hi Gleb!

Did you manage to create a complete brief keymap file?

I would love to have good old brief notation, and most likely I’m not the only one.
Could you possibly post your *.sublime-keymap file here?

It would be highly appreciated.
Thank you in advance!

Lukas

0 Likes

#7

For all you Brief, CRiSP, and MultiEdit users who want the Brief keystroke mappings, you can insert these into your Preferences…Key Bindings - User file:

{ “keys”: “alt+w”], “command”: “save” },
{ “keys”: “alt+x”], “command”: “exit” },
{ “keys”: “alt+e”], “command”: “prompt_open_file” },
{ “keys”: “ctrl±”], “command”: “close_file” },
{ “keys”: “keypad_multiply”], “command”: “undo” },
{ “keys”: “keypad_minus”], “command”: “cut” },
{ “keys”: “keypad_plus”], “command”: “copy” },
{ “keys”: “insert”], “command”: “paste” },
{ “keys”: “alt+i”], “command”: “toggle_overwrite” }

that’s just a start. Much more can be added.
hope it helps,

Cool Linux Guy
“Life is good.”

0 Likes

#8

Great - thanks gesman.

If anyone has more extensive Brief keystroke mappings and would like to share then that’d be appreciated.
Tom

0 Likes

#9

IIRC, the keypadN only work when it’s in numlock mode.

This sets keypad-5 (with numlock off) to scroll the line with the cursor to the center of the screen.
{ “keys”: “clear”], “command”: “show_at_center” },

I prefer “soft_undo”, which undoes motion in steps (though it does bundle some motion together) as well as actual edits.
{ “keys”: “keypad_multiply”], “command”: “soft_undo” },

0 Likes

#10

I have been playing with this and have gotten stuck.

I added: { “keys”: “end”, “end”, “end”], “command”: “move_to”, “args”: {“to”: “eof”, “extend”:false } },

It works fine. Unfortunately the end key by itself no longer works.

Any ideas of how to implement this with out breaking: { “keys”: “end”], “command”: “move_to”, “args”: {“to”: “eol”, “extend”: false} }, ?

Thanks,
Mason

0 Likes