Score:0

Map an Input From Keyboard to a Position on Screen

it flag

This is one complicated question, but here is what I am trying to accomplish.

I want to set the WASD keys and maybe others to a specific position on screen so that for example, if I press the W key, it would behave as if I clicked/touched/dragged in the position on screen X = 200, Y = 400.

UPDATE 1: I found a command called xdotool and more or less created the following:

xdotool mousemove 712 818 mousedown 1 mousemove_relative 15 35 mousedown 1 sleep 0.1 mouseup 1

This would click on the screen at that X / Y position when I press the letter S, drag the simulated mouse X + 15 & Y + 35 and then release the mouse. The problem is, I need to figure out a way for the release to happen when I stop pressing the letter S.

David avatar
cn flag
What is the version of Ubuntu you are using?
Luis Alvarado avatar
it flag
@David It actually would not matter. I am using 22.04, 22.10 and 23.04 for the tests here.
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.