51

Ok, I've used Ubuntu with GNOME for a while, but now I'm using XUbuntu. In Ubuntu, there used to be a keyboard preference which makes the numpad more sane, it was called something like "Make Shift+NumPad work like Windows".

The problem this options solves is, that when you press NumPad 7, it acts like the "Home" key, which is all fine, but if you press Shift+NumPad 7, it acts like the "7" key, which is not fine because I'm on a laptop and the regular "Home" key requires me to pull of an anatomically insane move. Anyways, this option made Shift+NumPad 7 act like the "Home" key.

I can't find that option under XUbuntu. How do I set it?

Update: GUI or command line, doesn't matter.

Raphael R.
  • 1,311

10 Answers10

65

After some grepping I found the solution: You need to add the numpad:microsoft option to the XkbOptions. On older Ubuntus, do that in your xorg.conf. On newer ones open the file /etc/default/keyboard and change this line:

XKBOPTIONS=""

to

XKBOPTIONS="numpad:microsoft"

Save and reboot (restarting X doesn't seem to work, at least not with RAlt+PrintScreen+K). You may need to run sudo dpkg-reconfigure keyboard-configuration for changes to take effect.

Raphael R.
  • 1,311
21

Ubuntu 14.04 have no more "Miscellaneous compatibility options" in the keyboard settings. Editing /etc/default/keyboard also is not a working solution. But dconf database contains the required options with key /org/gnome/desktop/input-sources/xkb-options. This options should be completed with numpad:microsoft to something like ['grp:alt_shift_toggle', 'grp_led:scroll', 'numpad:microsoft'] manually in dconf-editor or using this script:

# !/bin/bash
old=`gsettings get org.gnome.desktop.input-sources xkb-options`
new=`echo $old | sed "s/'numpad:microsoft'//g" | sed -r "s/(, )+/, /g" | sed -r "s/(, )?]/, 'numpad:microsoft']/"`
gsettings set org.gnome.desktop.input-sources xkb-options "$new"
tbrush
  • 311
  • 4
    awesome!! what on earth was someone smoking to remove this...
        Or, if this feature is some "evil windows thing", how are you supposed to do shift-end on the laptop, when the regular key is in a hard to reach place?
    
    – peter karasev Aug 18 '15 at 15:04
  • 2
    Great answer ! Btw instead of using the command line you can also install the dconf-editor in Ubuntu >= 12.04

    Check this answer for more details http://askubuntu.com/questions/22313/what-is-dconf-what-is-its-function-and-how-do-i-use-it

    – Storm Sep 21 '15 at 08:04
  • 1
    Works like a charm in 16.10. dconf-editor helped too, thanks @Storm! – Konrad Garus Feb 20 '17 at 17:50
  • On Elementary OS Loki, this is the only option that seems to work. – Abhishek Divekar Mar 09 '17 at 07:07
19

In Xubuntu 16.04 the XKBOPTIONS setting ( XKBOPTIONS="numpad:microsoft" ) in /etc/default/keyboard is ignored - I consider this to be a bug.

I'm using the following command as workaround:
setxkbmap -option 'numpad:microsoft'

In order to run the above command automatically when starting the graphical desktop environment, I've create an Application Autostart entry:
Menu > Settings > Session and Startup > Application Autostart > Add

          Name: Make Shift+NumPad work like MS Windows
Description: whatsoever
   Command:setxkbmap -option 'numpad:microsoft'

F.M.
  • 291
  • 1
    Works great, and without restart, thanks! But what do you mean by "Menu > Settings"? From where? I don't think you mean system settings. – David Parks Oct 14 '16 at 18:51
  • 1
    Hi David. I have created 5 screenshots: (1/5) https://imgur.com/a/h00IQ | (2/5) https://imgur.com/a/xUcJS | (3/5) https://imgur.com/a/n9Pq3 | (4/5) https://imgur.com/a/0m8Df | (5/5) https://imgur.com/a/rMVdj - hope this helps ;-) . – F.M. Oct 15 '16 at 23:41
  • This works on XUbuntu 18.04. No restart needed – abjbhat Jul 02 '18 at 14:50
  • Confirmed it works in 19 as well. The auto start is not here though. Just add a .sh to /etc/init.d – Emad Jul 20 '19 at 17:49
  • 1
    Works for Ubuntu Budgie 20.04! :+1: – nZeus May 14 '20 at 21:47
  • @F.M. For some reason doesn't work in Ubuntu 21.10. Maybe you have the understanding? – mktplus Feb 11 '22 at 06:55
14

Glad I found your post. Using Natty Narwhal, I found a similar option in the Keyboard settings.

  1. Search for Keyboard
  2. Click Layouts tab
  3. Click Options button
  4. Expand miscellaneous compatibility options
  5. Check "Shift with numeric keypad keys works as in MS Windows"
  6. Close and you're good!
Kit Menke
  • 240
  • Thank you! This is the only solution that worked for me - editing /etc/default/keyboard didn't work. – jocull Mar 25 '13 at 22:02
  • 5
    That option has been removed in 13.10. It can still be selected by installing gnome-tweak-tool: sudo apt-get install gnome-link-tool. Then you'll find it under "Typing" in the "Miscellaneous compatibility options" list. – f.cipriani Jan 08 '14 at 22:02
  • 3
    @f.cipriani I don't know if that was a typo in your comment or if the tool has been renamed, but the current correct name is gnome-tweak-tool. – waldyrious May 12 '14 at 10:12
  • 2
    Thanks @waldir, that was a typo, it is actually gnome-tweak-tool – f.cipriani May 12 '14 at 13:30
  • 2
    In Linux Mint 18 (Cinnamon), it appears the desired option under "Miscellaneous compatibility options" is "Numlock on: digits, Shift switches to arrow keys, Numlock off: always arrow keys (as in MS Windows)". – theDrake May 04 '17 at 21:55
6

For uBuntu 18.04, another options is to use Dconf-Editor, a powerful GUI for most uBuntu settings. If not installed, open Terminal and type:

  • apt-get update
  • apt-get install dconf-editor -y

Open dconf Editor, then /org/gnome/desktop/input-sources/xkb-options.

On a fresh uBuntu installation, Custom value will be blank. Turn Use default value OFF then:

  • insert ['numpad:microsoft'] (if blank) or
  • append , 'numpad:microsoft' (after whatever is there, if not blank)

For example, ['caps:none', 'numpad:microsoft'] which both disables Caps Lock and uses the NumPad as in Windows. Close dconf Editor, no reboot required.

AlainD
  • 849
3

On Ubuntu 19.10, you can get this functionality by installing gnome-tweak-tool, then opening it, going to Keyboard & Mouse -> Additional Layout Options then expanding Miscellaneous compatibility options and checking Num Lock on: digits; Shift for arrow keys, Num Lock off: arrow keys (as in Windows), as shown here:

Gnome Tweak Tool Config

The changes take effect immediately. It seems to change the same setting as the answer by @AlainD

SteveK
  • 141
3

I had a similar problem on lubuntu. I tried changing the /etc/default/keyboard file, but it didn't help.

I think the reason might be that I had Layout changer on my system. However, adding numpad:microsoft in the "Advanced setxkbmap Options" field in the options of the Keyboard Layout Handler actually worked. I didn't even have to reboot the X.

guntbert
  • 13,134
  • It means run this command: setxkbmap -option "grp:alt_shift_toggle,grp_led:scroll,numpad:microsoft" – Vahid Jul 19 '22 at 21:14
1

Kubuntu 20.04 also has Miscellaneous compatibility options menu! So, you can fix numlock and shift+home / shift+end issue.

enter image description here

James Bond
  • 811
  • 7
  • 5
0

Running Ubuntu 20.04 in Virtual Box on a Windows host, I needed to turn on these options in Tweaks to get shift- and control-shift- keys to work in Windows style.

  • Tweaks > Keyboard & Mouse > Additional Layout Options > Miscellaneous compatibility options > Shift does not cancel Num Lock, chooses 3rd level instead
  • Tweaks > Keyboard & Mouse > Additional Layout Options > Layout of Numeric Keypad > Wang 724 keypad with unicode additions (arrows and math operators; math operators on default level)

For example, in a text editor with NumLock on, this allows ctrl-shift-numpad4 to move left to the start of a word while selecting the word.

CMerrill
  • 101
-1

For me 'keypad:pointerkeys' option helped on Lubuntu 18.04 Bionic Beaver

  • I frequent many sites in stackexchange.com and I think I have noticed a disturbing pattern: the sites with the highest percentage of unhelpful answers seem to be the linux sites. – Mike Nakis Oct 01 '19 at 11:56