In a terminal, open /etc/default/grub.
Find the line that starts with GRUB_CMDLINE_LINUX_DEFAULT=.
Replace it with GRUB_CMDLINE_LINUX_DEFAULT="atkbd.reset i8042.reset i8042.nomux quiet splash".
Save and exit the file.
Run sudo update-grub.
If this doesn't work, follow the same process but try GRUB_CMDLINE_LINUX_DEFAULT="i8042....
It's because these keys send escape sequences instead of dedicated keycodes since the terminals that are being emulated did not have function keys
No. It's because the "terminal" protocol uses in-band signalling, where every byte is considered to be text by default and anything that isn't text has to be indicated specially (i.e. escaped), which ...
Ok, let's sum up:
First step is to use evtest and see if this also happens on the kernel input layer. Also, RF keyboards sometimes have multiple input devices associated to them (use evtest on all of them to verify), so if the XF86Forward happens to come from a different device than the actual keypresses, ignoring that device would be an easy fix.
It turned ...
So, https://github.com/autokey/autokey/wiki was the answer to my question, thanks to @Panki, for helping me get on track! Autokey expands your abbreviations like "tdx" into anything anywhere where you type it. Magnificent!
I know that this answer is late (about 7 years), but even I had the same problem and found the solution and I want to share it so that other who have the same problem might benefit from it.
Change the keyboard layout from "English (UK)" to "English (US)". This solves the problem.