Fixing wrong Shift+Numpad (keypad) behaviour in Emacs
I struggled for a about an hour today with S-kp-home trying to bind it to something that would work properly in emacs (i.e select the text between cursor and start of line) before I figured out that although the problem manifested itself in Emacs, it is really due to the way Xwindows maps the Shift+Home/End… keys on some laptops.
Problem:
Pressing the Shift+Home key combo should select the text from cursor position to beginning of current line.
Instead what happens is the Shift modifier is applied to the keypad key (Home/7 in my particular case) as if it were a normal key which results in this key combo (Shift-Home) being translated into ‘7’ or ‘Home’ depending on whether the NumLock is ON or OFF.
Solution:
1.For Gnome Users:
Go to System -> Preferences -> Keyboard -> Layouts -> Options -> Miscellaneous. Select the “works as in MS Windows” check box:
2.For KDE users:
Same setting is available in “Misc Compatibility Options”.
3.Generic solution for all other environments (incl XFCE):
3.1. Find your xorg.conf file. Typical locations would be:
/etc/X11/xorg.conf
/etc/xorg.conf
/usr/X11R6/lib/X11/xorg.conf
If none if the above exists on your system then just create an empty xorg.conf file in one of these places and edit it.
NOTE: Newer systems use xorg.conf.d directory with dynamic files instead of a xorg.conf file. These are usually in:
/etc/X11/xorg.conf.d
Look for this file:
/etc/X11/xorg.conf.d/01-keyboard-layout.conf
If none if the above exists on your system then just create an empty xorg.conf file in one of these places and edit it.
3.2. Add the following to the xorg.conf file:
Section "InputClass" Option "XkbOptions" "numpad:microsoft" EndSection
– – – –
… by the way – to take a screenshot of the Gnome menu expanded you can use:
$ gnome-panel-screenshot --delay 5
This will delay the screenshot taking by 5 seconds which should give you enough time to navigate through the menus…
-
Categories
- Android Development
- Bash
- C programming
- dpkg/apt-get
- drupal
- Emacs
- Git
- Java
- Linux administration
- Linux device drivers
- Linux Gaming
- Linux kernel
- Linux Networking
- Linux on Windows
- Linux printing
- Linux sound and ALSA
- Package Managers
- Programming
- RPM
- Shell and environment
- Tips and tricks
- Uncategorized
- VirtualBox
- Virtualization
- web development
- wine
- WMaker
- Wordpress Tips
- X Window System
- XFCE
-
Articles
- August 2020
- August 2019
- May 2019
- July 2017
- February 2017
- January 2017
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- April 2016
- March 2016
- December 2015
- November 2015
- September 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- October 2014
- February 2014
- January 2014
- November 2013
- October 2013
- June 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- September 2011
- August 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
-
Meta
Cloud
audio bash boot compile C programming cups drupal emacs etc Fedora git grep how to httpd init kernel libc linux linux partition localtime login make mount mp3 mysql networking oracle package managers password phpMyAdmin programming rpm shell sql vbox version control system virtual box vm web server wordpress www xargs xfce xwin yum