0

I just setup Ubuntu 15.04 on my Asus G74Sx laptop. This laptop does not have a physical NumLock key.

My Numpad works fine in Windows 8.1, the SSTYs, as well as lightdm (I can enter numbers via the numpad into the password input).

After logging into Unity it only works for a short time. I succeeded once opening up a terminal and inputting a few numbers, before it got disabled. If I logout it no longer works in lightdm either. I can enable it using numlockx on.

I already tried adding numlockx on to my autostart programs (which did not work) and also using dconf-editor to change org → gnome → settings-daemon → peripherals → keyboard according to a tutorial on German Ubuntuusers (which gets reset after reboot).

The accessibility feature to move the mouse via the numpad is not enabled.

It looks like something disables the numpad after logging into Unity. Any idea?

TimWolla
  • 288

2 Answers2

1

Adding the command numlockx on to Startup Applications

Some commands break if you add them to startup applications, because the command needs a fully loaded desktop to run successfully, and Startup Applications runs the commands too early.

If the command

numlockx on

works once you are logged in, I am pretty sure it is a matter of timing to make it work as a startup application. You can add a little break to make it work.

Since Startup Applications creates a .desktop file in ~/.config/autostart to run the startup command, you need the "regular" syntax to add a complicated command (including the break) to be used in a .desktop file, which is in this case:

/bin/bash -c "sleep 15&&numlockx on"

Possibly, you need to play a little with the sleep 15 to optimize.

Edit

An alternative method to run the command at startup is mentioned here, but the result is the same.

EDIT

If your startup procedure (-time) is unpredictable for some reason and/or the numpad is set to off repeatedly by some process during startup, you can make sure it works correctly by adding the script below to your Startup Applications

It keeps an eye on the Numpad, to be set on during the first minute after startup (log in):

#!/bin/bash

n=1 while [ "$n" -ne 60 ]; do if [ "$( numlockx status )" != "Numlock is on" ]; then numlockx on fi sleep 1 n=$((n+1)) done

Add to Startup Applications: Dash > Startup Applications > Add, add the command:

/bin/bash /path/to/script.sh
Jacob Vlijm
  • 85,475
1

I solved my issue by using gnome-tweak-tool to access the now unavailable keyboard settings of former Gnome / Ubuntu versions.

As I stated my in question my keyboard does not have a physical num lock key. The keys do not have any print for the other functions either:

photo of my numpad

A thread in BackTrack Linux forum suggested to check “Numeric keypad keys work as with Mac”. Further searching revealed this screen shot from an older Gnome version:

which can be found in this answer: https://askubuntu.com/a/130213/27683.

I “ignored” this answer, as the menu is gone in newer Ubuntu versions. Fortunatly I also wanted to disable Caps Lock. Searching revealed that one has to use gnome-tweak-tool to disable Caps Lock. gnome-tweak-tool basically brings back that old menu. Therefore I could also enable the setting to fix my num pad.

gnome-tweak-tool the hero

According to launchpad bug tracker this is the recommended way to enable those additional settings: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1245199/comments/6

TimWolla
  • 288