Score:1

How do I make a shortcut that types "o" when I I hit Alt+p?

pe flag

A few of my keys on my keyboard have stopped working after an accident. For the time being I want to know how I can remap these faulty keys to a shortcut. For example mapping "o" to Alt+p.

I have tried simply setting a shortcut with the command echo "o" but that doesn't work. I have also tried xmodmap but I can't seem to get it. Any help? Thanks!

Ubuntu 20.04.3 LTS

Score:1
cn flag

As long as you are on Xorg, xmodmap should be the appropriate tool. Alternatively, you can bind a command to Alt+p that simulates hitting o using xdotool.

xdotool keyup alt keyup p type o

This first releases the hotkey you are pressing, then types an o.

Linux distributions, including Ubuntu, are moving to Wayland. Both tools do not anymore work on Wayland. The most fundamental way to adapt your keyboard layout, i.e., editing kbe configuration files, will continue to work but this is very complicated.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.