LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having 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


Reply
  Search this Thread
Old 04-20-2024, 10:39 AM   #1
Bonz0
LQ Newbie
 
Registered: Apr 2024
Posts: 8

Rep: Reputation: 0
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?
 
Old 04-20-2024, 11:22 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,740

Rep: Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923
Welcome to LinuxQuestions.

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?
 
Old 04-20-2024, 12:02 PM   #3
Bonz0
LQ Newbie
 
Registered: Apr 2024
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by michaelk View Post
Welcome to LinuxQuestions.

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.
 
Old 04-20-2024, 04:00 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,740

Rep: Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923
It may help to know what distribution you are running and if it is Xorg or Wayland.
 
Old 04-20-2024, 04:45 PM   #5
Bonz0
LQ Newbie
 
Registered: Apr 2024
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by michaelk View Post
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.

https://www.ultrabookreview.com/3608...a401iv-review/
 
Old 04-22-2024, 03:17 PM   #6
Bonz0
LQ Newbie
 
Registered: Apr 2024
Posts: 8

Original Poster
Rep: Reputation: 0
I figured out something that works but not quite in the way that I wanted. I have pgup/pgdown working with AltGr right/left.

Apparently I can put a file called "custom" under /usr/share/X11/xkb/symbols and it won't be overwritten. In that file I have this:

default partial alphanumeric_keys
xkb_symbols "gb_custom" {

include "gb(basic)"

name[Group1]="English (UK) custom";

key <LEFT> { [ Left, Left, Next ] };
key <RGHT> { [ Right, Right, Prior ] };

include "level3(ralt_switch)"
};

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.
 
Old 04-23-2024, 12:01 PM   #7
Bonz0
LQ Newbie
 
Registered: Apr 2024
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Computer detecting right-click as left-click, left-click as left-click and middle with 2 fingers pressed as right-click Festerdam Linux - Newbie 5 06-19-2017 05:41 PM
[SOLVED] Control characters in Shell mode (left, right, up and down arrow keys) jags1984 Linux - Newbie 19 04-03-2013 11:19 PM
Swapping PgUp and Shift Keys in Fedora 14 BarbieQ1 Linux - Laptop and Netbook 0 07-31-2011 11:05 PM
scroll left goes right and right goes left adamruss Linux - Hardware 2 08-17-2007 11:31 AM
Home, end, pgup, pgdown keys not working antimatter3009 Linux - Desktop 1 12-29-2006 03:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 06:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration