Score:0

launch a command when joystick button is pressed

br flag

I am looking for a way for make ubuntu able to map one certain key on my arcade stick as "esc" key on keyboard.

I am building a ubuntu based bartop and everything works fine except some emulators that, for exit force me to use the keyboard esc key and there is no way to map other keys.

is there a way to do it ? Is since one week i am looking around for some working solution but without success

I am running Ubuntu 18.0.4

Thanx in advance for any help

David avatar
cn flag
Unless there is a Ubuntu driver for the joystick I very much doubt you can do that.
br flag
but the joystick ( dragonrise ) is correctly recognized and usable , also if I runn jtest all the buttons are correctly recognized
David avatar
cn flag
Where in the question have you given that info? You get help based on what you say in the question. So 2 things. 1. Edit the question and add that detail. 2. What else have you failed to include?
Sadaharu Wakisaka avatar
pl flag
Welcome to AskUbuntu, it is basically the same question of 'binding key on mouse button' [here](https://askubuntu.com/questions/1160364/mapping-the-extra-mouse-buttons-to-page-up-and-page-down)
Score:0
pl flag

Open Terminal and run xev to check the code of the button you want.

When you press the button to asign ESC you read

ButtonPress event, serial 40, synthetic NO, window 0x6400001,  
root 0x1db, subw 0x0, time 152278931, (159,99), root:(1901,151),  
state 0x0, button 3, same_screen YES

Something like this, important point is button 3 that is the number you need to know.

Then edit $HOME/.xbindkeysrc
Add

"xte 'key Escape'"  
b:3+release

Reload the .xbindkeysrc by killall -HUP xbindkeys

Note: the number of your mousebutton probably is not 3.

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.