Score:2

Globally redirect keyboard input to specific unfocused app

jp flag

Goal

When I press the arrow keys, no matter what application is used/being focused the arrow keys should always be transmitted to the browser. It isn't necessary that only the browser receives the input, if both the focused application and the browser get it simultaneously, that is fine. I'm using Kubuntu 20 & 22.

What I tried

I tried to use the Custom Shortcuts settings app where I created a Send Keyboard Input of the Global Shortcut type. It was triggered by an arrow key and executed the matching arrow action resulting in the proper keypress when I tested it with applications like Dolphin, LibreOffice Calc. If I pressed the arrow keys anywhere, it controlled Dolphin or Calc.

Problem

The solution described above doesn't work with browsers. Even in Dolphin, it didn't work inside fields because they became unfocused which is acceptable for me, but for browsers (I used keyboard testers) it didn't work at all. If I focus the browser it starts to work but even in that case both events are registered. If I create a shortcut that presses K on then the event logger shows both keyboard events. How to achieve my goal? I don't insist on using Custom Shortcuts I'm open for any solution.

HRSE avatar
lr flag
This would be incredibly useful with in combination with editors like vim or emacs. All keyboard input goes to the editor and one uses mouse/touch input for other apps.
I sit in a Tesla and translated this thread with Ai:

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.