[SOLVED] Is there a way to remap the right Ctrl-key to be another Fn?

I’m interested in finding out if there’s a way to remap the right Ctrl-key to double as the Fn key. As several people on here have pointed out over the years, for those of us who extensively use the Page Up/Down/Home/End function of the arrow keys, it would be so much more helpful to have the Fn key right next to them, so it can be dealt with single-handedly.

Should there be a way to only switch between the simple single-step and the farther reaching navigation of those keys, with the help of another command, one that wouldn’t try to duplicate the Fn button, that would also work.

I’ve attempted to remap the right Ctrl-key with the help of Input Remapper, but I can’t find the right name – “NumLock” doesn’t do anything, and I am unable to find a list of names anywhere. Typing “arrow” into the field to rename the key doesn’t return anything.

Would be most grateful for a suggested solution.

I use this project to remap keys. It’s pretty easy to use. Works on wayland and X.

Keyd is a good alternative for KMonad. Less advanced / less configurable but easier to set up, while still offering layers.

I haven’t used keyd before, but it looks like you could do a simple momentary layer like this

# R-Ctrl + arrows = alt arrow functions
[ids]
*
[main]
rightcontrol = layer(altarrows)
[altarrows]
up = pageup
down = pagedown
left = home
right = end

Looks like you can even do a momentary plus locking layer like so

# R-Ctrl + arrows = alt arrow functions
# R-Ctrl + / = toggle lock of arrow alt functions
[ids]
*
[main]
rightcontrol = layer(altarrows)
[altarrows]
up = pageup
down = pagedown
left = home
right = end
/ = toggle(altarrowslock)
[altarrowslock]
up = pageup
down = pagedown
left = home
right = end

I don’t have keyd installed, so this is untested.

~edit~ config error in momentary plus locking corrected

Thanks for trying to help, @TJ1 and @MJ1 – it likely is easy if you’re a linux geek, not a casual user, though.

I followed the instructions on keyd’s github page to install it, and then I added the code you offered to the “/etc/keyd/default.conf” file, with the exception of swapping out the “/” for “shift” because “/” doesn’t exist on my German keyboard at the English location. (NOTE: I did not add the code they recommend, re escape and capslock, because I don’t want those changes.)

I also ran “sudo keyd reload” which I believe is meant to apply the changes (it’s not clear from the instructions).

Nothing happened.

I then thought that maybe the keys would be called differently on my system, since I use a German keyboard (though I don’t think the underlying key names would actually be different, just because the physical keys are a different language). To check this I entered the “keyd monitor” command into the terminal. Which caused this output:

keyd monitor
failed to open /dev/input/event1
failed to open /dev/input/event2
failed to open /dev/input/event0
failed to open /dev/input/event3
failed to open /dev/input/event5
failed to open /dev/input/event4
failed to open /dev/input/event8
failed to open /dev/input/event7
failed to open /dev/input/event6
failed to open /dev/input/event9
failed to open /dev/input/event10
failed to open /dev/input/event11
failed to open /dev/input/event12
failed to open /dev/input/event13
failed to open /dev/input/event14
failed to open /dev/input/event15
failed to open /dev/input/event16
failed to open /dev/input/event17
failed to open /dev/input/event19
device added: 0001:0001:4c2df846 input-remapper gamepad (/dev/input/event18)

and the terminal is stuck at that. I have no idea how to call this properly, but it doesn’t return to showing the prompt with my username.

Maybe it’s time to give up and make peace with the shortcomings of the keyboard for my purposes. :cry:

Does Ctrl + c end it & return you a prompt for a new command? That’s the normal key combination for ending commands. Sometimes key monitor programs will provide a different way to end, or they’ll just say they will time out / auto-end if you don’t press any keys.

Nope. First thing I tried before simply closing the terminal window. But that’s not the big problem; I just wanted to mention it.

I keep forgetting that there’s no footer here in this board; I’m used to using phpBB boards were you have a signature to let others know what system you have and that you’re not a total newbie. :wink:

I just set up keyd on Fedora 40 as a sanity test, worked fine. Here’s exactly what I did:

$ sudo dnf copr enable alternateved/keyd
$ sudo dnf install keyd
$ sudo mkdir /etc/keyd
$ sudo vim /etc/keyd/default.conf
...
$ sudo systemctl restart keyd

I do mean exactly – I might have missed a sudo systemctl enable keyd, and odds are you have a preferred text editor other than vim.

I had to type in ‘y’ a few times to allow for adding the repository to dnf.

My /etc/keyd/default.conf is

[ids]

*

[main]
rightcontrol = layer(altarrows)

[altarrows]
up = pageup
down = pagedown
left = home
right = end

keyd monitor, without any special privileges, has no problem reading my various /dev/input/event*s.

I’m not an Ubuntu user but some quick web searches suggest that you may need to add your user to the input group in order to have read permission on your input devices.

Also, Fedora’s dnf is analogous to Ubuntu’s apt. It’d be a different repo for you, etc. (That was probably obvious, but you never know.)

2 Likes

Thank you @James_Jarrett! I ran “sudo keyd monitor” again to troubleshoot. I realized the big difference between your code and the one provided by @MJ1 was the fully written out “pageup” and “pagedown” – yours matches the output I had in my terminal while I was testing things.

I changed it – and now it works! Yay! Very happy and gratefull for all of you helping me with this – and hopefully others with the same issue.

1 Like

Ah, apologies.
Funny thing is, I noticed the error & fixed it, but only in the first code block for momentary-only.

I failed to fix it in the second code option, for momentary + locking. I’m guessing you were using that one.