Map ctl left/right to pgup/pgdown on laptop with no pgup/down keys
Linux - Laptop and NetbookHaving a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Map ctl left/right to pgup/pgdown on laptop with no pgup/down keys
My Asus G14 has no pageup/down keys so I would like to map ctl left/right to pgup/down. I'm mostly concerned with X not the console. I assume that it would work in a terminal emulator? The documentation I've read on this looks pretty mind numbing but maybe there's a simple way to do it that I'm missing?
I've noticed that ctl up/down is mapped to home/end. Where would this be configured?
On my old Asus laptop:
home = ctrl + left arrow
end = ctrl + right arrow
page up = ctrl + up arrow
page down = ctrl + down arrow.
Granted there are different models of the G14 but the pictures of the keyboard I found it looks the same and marked accordingly. I guess I don't know why it would change?
On my old Asus laptop:
home = ctrl + left arrow
end = ctrl + right arrow
page up = ctrl + up arrow
page down = ctrl + down arrow.
Granted there are different models of the G14 but the pictures of the keyboard I found it looks the same and marked accordingly. I guess I don't know why it would change?
I don't think I'm mistaken about this. There are no marks on the arrow keys except arrows and on the up/down there's a keyboard symbol because keyboard backlight is set with fn up/down. I saw a post on a forum that said that ctl up/down was mapped to home end and when I tried it out it was. ctl left/right is not mapped to anything as far as I can tell. I saw a post on a forum where an Asus person admitted there was no pgup/down on some Asus G14's.
It may help to know what distribution you are running and if it is Xorg or Wayland.
It's Debian testing. Xorg. I assume that a generic UK QWERTY keyboard configuration doesn't cover the platform specific quirks? If not where is that configured?
From what I've seen setxkbmap can be used but it's not straightforward.
See this review where he says "there are no Home/End/PgUP/PgDn keys with this layout, not even with key combos".
There is home and end but I'm not sure it's documented.
By including gb(basic) I only have to include the keys that I want to modify. Prior/Next mean pgup/pgdown. The fact that Prior/Next are third in the list means that they are the result of pressing AltGr. First on the list is the key with no modifier. Second is shift. Third AltGr and fourth shift+AltGr.
The keymap can be loaded with "setxkbmap custom" and in /etc/default/keyboard XKBLAYOUT="custom".
A picture of the physical keyboard model with the key names (pc105 in my case) can be produced with xkbprint -label name -o names.ps $DISPLAY; ps2pdf names.ps.
I was thrown off by the fact that in the layout image the right arrow key was called RIGHT but in the file /usr/share/X11/xkb/keycodes/evdev it's called RGHT.
It's quite easy to have keys output any character you want once you know how to do it but I still don't know how to include the cntl key to do cntl left/right. I haven't found where cntl up/down is mapped to home/end. Having said that home/end doesn't work in a terminal emulator but my mapping of pgup/down does.
The layout is set with a xfce startup script that executes when you log on.
I've left my xfce keyboard config as it it for now. I don't know if there will be any conflicts. Something shows up in xfce's keyboard settings called "A user-defined custom layout" but it's not clear whether this is my custom layout.
I found another way to do it that's allot simpler and doesn't seem to reset when resuming from sleep.
Fn left/right give out key codes that seem to be mapped to XF86Launch2 and XF86Launch3. I found the keycodes with xev. When I tried to map these to pgup/down using the setxkbmap method it didn't work. However mapping with xmodmap did work and doesn't involve making a custom layout.
I put the following in a file caled ~/.Xmodmap
keycode 157 = Next
keycode 210 = Prior
Then execute xmodmap ~/.Xmodmap. Apparently using xmodmap is the old way to do it so I don't know how long it will be before it breaks but for now it works a treat.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.