Enable numlock automatically

Source: Internet
Author: User

Windows:

1. Set the numlock entry to enable in bios, and set the PNP with OS entry to enable in BIOS. However, when logging out of a user, the numlock is disabled and must be opened manually.

2. Open Registry Editor and find HKEY_USERS /. default/control panel/keyboard, change the key value of initialkeyboardindicators under it to "2", exit the Registry Editor, restart the computer, and you will find that the lights on the keypad are no longer out.

3. In addition, you only need to perform minor operations on the config. SYS file. The setting method is as follows:
1. Click the "run" command in the "Start" menu, type "sysedit" in the "open" box, and press the Enter key to open the "System Configuration editing program" window.
2. Click the "config. sys" title bar, switch it to the current editing window, and type "numlock = on" in the editing area.
3. Save the changes and close the System Configuration editor window.

In Linux:

1. In the KDE environment:
KDE Control Center --> peripherals --> keyboard --> numlock is enabled when KDE is started.

2. Windows maker:

Code:
# Include </usr/x11r6/include/X11/extensions/xtest. h>
# Include </usr/x11r6/include/X11/keysym. h>

Int main (void)
{
Display * disp = xopendisplay (null );
If (disp = NULL) return 1;
Xtestfakekeyevent (disp, xkeysymtokeycode (disp, xk_num_lock), true,
Currenttime );
Xtestfakekeyevent (disp, xkeysymtokeycode (disp, xk_num_lock), false,
Currenttime );
Xclosedisplay (disp );
Return 0;
}
1) Save the above Code as numlock. c
2). GCC-I/usr/x11r6/include-L/usr/x11r6/lib-O setnumlock numlock. C-lx11-lxtst
3) EDIT. xinitrc or. xsession to add the following content.
/Usr/x11r6/bin/setnumlock

3. Modify/etc/X11/xf86config:
Add the following content to the keyboard section:
# Let the server do the numlock processing. This shoshould only be
# Required when using pre-R6 clients
Servernumlock

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.