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.

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:

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.