Sublime Forum

Numeric Keypad keys not working

#1

Hi,

Love sublime ! best editor I’ve used :smiley: .

My Windows computer numeric keypad keys will not work in sublime text 3. If I go to another window say notepad they work, come back to sublime they don’t work.

I have these packages installed:

  • Package Control.sublime-package
  • Alignment.sublime-package
  • DocBlockr.sublime-package
  • Laravel 4 Snippets.sublime-package
  • LiveStyle.sublime-package
  • Phix Color Scheme.sublime-package
  • Theme - Soda.sublime-package

is there any way to fix this.

I can confirm that they work in ubuntu

0 Likes

Numlock not working in a remote Linux session
#2

In the ST console, enter “sublime.log_input(True)”. Then press the numeric keypad keys. What comes up in the console?

0 Likes

#3

I’m having a similar issue on a fedora box, only over VNC. has anyone else seen this?

when i type my keypad keys (and enable input logging) it shows they come is as shift+(their non-num lock function) so for example 2 is (shift+down).

This is with numlock on, with numlock off they take on their non-numlock functionality (2 is just down).

I commented out the shift+(x) functionality in the key definition file and now i get the straight numbers in, but i can’t do shift down, up, left, right, pgup/pgdn etc etc.

This is on a VM, and on the console it does not behave this way just over VNC.

also other text editors don’t have this problem over VNC.

0 Likes

#4

Did anyone solve this problem already as I’m running into the same problem connecting to an Ubuntu desktop with a remote desktop connection and using Sublime Text 3. With numlock on, the keys register as SHIFT+(non-numlock) and with numlock of they register just as the non-numlock function. All the other programs that I run don’t have this problem.

0 Likes

#5

I have the same problem in Ubuntu Mate and using Sublime Text 3

0 Likes

#6

For XRDP connections, I finally solved the problem by editing the keymap file. In my case this is km-0409.ini but it should work for all files. I am using Ubuntu Mate and access it with Windows Remote Desktop Connection.

Before you start, please create a backup of your keymap file as this is something that is not thoroughly tested and may interfere with other things.

Step 1: In case you use another keymap file, run xmodmap -pk > Layout.txt from a terminal. In that file look for the key numbers associated with the KP_ keys. In my default file these are the key numbers between 79 and 91.

Step 2: Go to /etc/xrdp and sudo edit the keymap file you are using (e.g. km-0409.ini) and replace the values of the keys you identified in the previous step with the correct unicode values (http://unicode-table.com/en/#control-character). I only changed the values under [noshift].
For me the values are as follows:

Key number | New value | Character displayed
79 | 55:55 | 7
80 | 56:56 | 8
81 | 57:57 | 9
82 | 45:45 | -
83 | 52:52 | 4
84 | 53:53 | 5
85 | 54:54 | 6
86 | 43:43 | +
87 | 49:49 | 1
88 | 50:50 | 2
89 | 51:51 | 3
90 | 48:48 | 0
91 | 46:46 | .

Step 3: Save the file and reboot the system.

There is one small issue that I could not solve yet and that is the fact that the numbers now only work when Num Lock is off. In the remote session this is no problem as it seems that all other programs still show the correct input from the keypad even when Num Lock is off. When going back to the host system this is of course still a problem. Maybe this can be solved by also changing the values under the [shift], [alt-gr], [capslock], … items but I haven’t had time to check that yet.

Edit: Confirmed it works with Num Lock on when you change the values under all items in the ini file [shift], [noshift], [capslock], … Again, this might break other stuff but for now it works.

Edit 2 This will obviously break the non-Num Lock input so it becomes impossible to use e.g. the Home or PgUp key from the numeric keypad. This can most likely be solved by only changing values before or after the ‘:’ and in some specific items in the ini file. As I don’t use these keys on the numeric keypad this is no issue for me.

1 Like