个人工具

“UbuntuHelp:NumLock”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的8个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/NumLock}}
 
{{From|https://help.ubuntu.com/community/NumLock}}
 
{{Languages|UbuntuHelp:NumLock}}
 
{{Languages|UbuntuHelp:NumLock}}
 +
== Enabling Numlock upon login in Jaunty and Karmic ==
 +
System -> Preferences -> Keyboard -> Layout -> Layout Options -> Miscellaneous compatibility options -> turn on "Default numeric keypad keys"
 +
This setting takes effect after logging in and does not affect the graphical login screen or local consoles. 
 
== Enabling NumLock during startup and before login ==
 
== Enabling NumLock during startup and before login ==
 
Here's how to enable numlock to stay on during startup and before you login so it is on before you enter your username password into the logon screen
 
Here's how to enable numlock to stay on during startup and before you login so it is on before you enter your username password into the logon screen
第6行: 第9行:
 
If you are using GDM you can use numlockx:
 
If you are using GDM you can use numlockx:
 
* Install '''numlockx''' using apt-get, aptitude or Synaptic
 
* Install '''numlockx''' using apt-get, aptitude or Synaptic
* Edit '''/etc/X11/gdm/Init/Default'''
+
* In Hardy and Gutsy, edit '''/etc/gdm/Init/Default'''. For older versions of ubuntu edit '''/etc/X11/gdm/Init/Default''' instead.
** Find the line  
+
* Find the line <pre><nowiki>
<pre><nowiki>
+
 
exit 0</nowiki></pre>
 
exit 0</nowiki></pre>
* Add the following code above that line
+
* Add the following code above that line<pre><nowiki>
<pre><nowiki>
+
 
if [ -x /usr/bin/numlockx ]; then
 
if [ -x /usr/bin/numlockx ]; then
/usr/bin/numlockx on
+
  /usr/bin/numlockx on
 
fi</nowiki></pre>
 
fi</nowiki></pre>
*In Ubuntu Gutsy 7.10 use path: "/etc/gdm/Init/Default" instead.
+
* Also.. even if the numlock light on your keyboard is on.. there is a setting that can override it. System->Preferences->Keyboard.. then click the "Mouse Keys" tab and make sure to uncheck "Pointer can be controlled using the keypad".
 +
=== Enabling NumLock in KDM ===
 +
This is similar to the instructions for GDM.  Edit '''/etc/kde4/kdm/Xsetup''' (if you are still running kde3 you will want to edit '''/etc/kde3/kdm/Xsetup''' instead) and add the following code to it:
 +
<pre><nowiki>
 +
if [ -x /usr/bin/numlockx ]; then
 +
  /usr/bin/numlockx on
 +
fi
 +
</nowiki></pre>
 
=== Enabling NumLock in KDE (as used in Kubuntu) ===
 
=== Enabling NumLock in KDE (as used in Kubuntu) ===
 
From the K Menu, launch System Settings and click on Keyboard (Edgy users: K Menu -> System Settings -> Keyboard and Mouse -> Keyboard). You can see in the middle section the options for "NumLock on KDE Startup", where you can choose to Turn On, Turn Off, or Leave Unchanged. Select "Turn On" to turn NumLock on at startup.
 
From the K Menu, launch System Settings and click on Keyboard (Edgy users: K Menu -> System Settings -> Keyboard and Mouse -> Keyboard). You can see in the middle section the options for "NumLock on KDE Startup", where you can choose to Turn On, Turn Off, or Leave Unchanged. Select "Turn On" to turn NumLock on at startup.
第22行: 第30行:
 
<pre><nowiki>
 
<pre><nowiki>
 
/usr/bin/numlockx on
 
/usr/bin/numlockx on
 +
</nowiki></pre>
 +
=== Enabling NumLock for Virtual Consoles (TTYs) ===
 +
If you use the virtual consoles regularly, then you will quite likely want to have numlock on for the TTYs after boot up.  The status of numlock/scroll-lock/capslock can be manipulated with the '''setleds''' command.  One way to guarantee that numlock will be turned on after bootup for the TTYs is to run '''setleds''' via '''rc.local''' (a script run after every runlevel change; which in particular runs after booting up).  To do so add something similar to the following in the file '''/etc/rc.local''':
 +
<pre><nowiki>
 +
# Turn Numlock on for the TTYs:
 +
for tty in /dev/tty[1-6]; do
 +
    /usr/bin/setleds -D +num < $tty
 +
done
 
</nowiki></pre>
 
</nowiki></pre>
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月19日 (三) 23:46的最新版本

Enabling Numlock upon login in Jaunty and Karmic

System -> Preferences -> Keyboard -> Layout -> Layout Options -> Miscellaneous compatibility options -> turn on "Default numeric keypad keys" This setting takes effect after logging in and does not affect the graphical login screen or local consoles.

Enabling NumLock during startup and before login

Here's how to enable numlock to stay on during startup and before you login so it is on before you enter your username password into the logon screen

Enabling NumLock in GDM (as used in Ubuntu Gnome and Xubuntu XFCE)

If you are using GDM you can use numlockx:

  • Install numlockx using apt-get, aptitude or Synaptic
  • In Hardy and Gutsy, edit /etc/gdm/Init/Default. For older versions of ubuntu edit /etc/X11/gdm/Init/Default instead.
  • Find the line
exit 0
  • Add the following code above that line

if [ -x /usr/bin/numlockx ]; then

 /usr/bin/numlockx on
fi
  • Also.. even if the numlock light on your keyboard is on.. there is a setting that can override it. System->Preferences->Keyboard.. then click the "Mouse Keys" tab and make sure to uncheck "Pointer can be controlled using the keypad".

Enabling NumLock in KDM

This is similar to the instructions for GDM. Edit /etc/kde4/kdm/Xsetup (if you are still running kde3 you will want to edit /etc/kde3/kdm/Xsetup instead) and add the following code to it:

if [ -x /usr/bin/numlockx ]; then
  /usr/bin/numlockx on
fi

Enabling NumLock in KDE (as used in Kubuntu)

From the K Menu, launch System Settings and click on Keyboard (Edgy users: K Menu -> System Settings -> Keyboard and Mouse -> Keyboard). You can see in the middle section the options for "NumLock on KDE Startup", where you can choose to Turn On, Turn Off, or Leave Unchanged. Select "Turn On" to turn NumLock on at startup.

Enabling NumLock from startx

If you are not using a graphical display manager then add the following line to /etc/X11/xinit/xinitrc

/usr/bin/numlockx on

Enabling NumLock for Virtual Consoles (TTYs)

If you use the virtual consoles regularly, then you will quite likely want to have numlock on for the TTYs after boot up. The status of numlock/scroll-lock/capslock can be manipulated with the setleds command. One way to guarantee that numlock will be turned on after bootup for the TTYs is to run setleds via rc.local (a script run after every runlevel change; which in particular runs after booting up). To do so add something similar to the following in the file /etc/rc.local:

# Turn Numlock on for the TTYs:
for tty in /dev/tty[1-6]; do
    /usr/bin/setleds -D +num < $tty
done