[1.0.0] Options screen recognizes input sent by xdotool, but bound keys do not work in-game
Posted: Wed Nov 18, 2020 5:56 pm
Background:
I have a gaming mouse with several extra buttons, and the vendor has decided it's not worth porting their configuration software to Linux. This prevents me from changing the button bindings without rebooting into Windows. To solve this problem I assigned all buttons to single keypresses from 'a' to 'v' sequentially, and I wrote a program that grabs the keyboard input from the mouse, and responds to keypresses by executing predefined commands. It works quite well, and in fact it makes my mouse a much more powerful tool than what the vendor can give me, because it can make any button do literally anything.
Bug report:
I mapped mouse buttons 4 and 5 to 'xdotool click 8' and 'xdotool click 9' respectively, which simulates the standard button presses. This setup works fine everywhere, at least in standard desktop apps (Factorio is the first game where I tried to use these buttons). When changing the controls in Factorio, I can use those buttons fine (the input bindings will be changed to the correct mouse button). However when I go in game and press the buttons, the game doesn't seem to recognize the inputs.
I thought the game doesn't properly see button presses that happen very quickly, possibly entirely within the time between updates, as a simulated button press might be. I tried to change my program to execute 'xdotool mousedown 8' and 'xdotool mouseup 8' when the buttons are pressed and released, respectively, but that didn't work.
Info:
My computer runs Arch Linux, with XOrg and KDE as my desktop environment. My kernel is linux-lts.
Link to the program, if you're curious
I have a gaming mouse with several extra buttons, and the vendor has decided it's not worth porting their configuration software to Linux. This prevents me from changing the button bindings without rebooting into Windows. To solve this problem I assigned all buttons to single keypresses from 'a' to 'v' sequentially, and I wrote a program that grabs the keyboard input from the mouse, and responds to keypresses by executing predefined commands. It works quite well, and in fact it makes my mouse a much more powerful tool than what the vendor can give me, because it can make any button do literally anything.
Bug report:
I mapped mouse buttons 4 and 5 to 'xdotool click 8' and 'xdotool click 9' respectively, which simulates the standard button presses. This setup works fine everywhere, at least in standard desktop apps (Factorio is the first game where I tried to use these buttons). When changing the controls in Factorio, I can use those buttons fine (the input bindings will be changed to the correct mouse button). However when I go in game and press the buttons, the game doesn't seem to recognize the inputs.
I thought the game doesn't properly see button presses that happen very quickly, possibly entirely within the time between updates, as a simulated button press might be. I tried to change my program to execute 'xdotool mousedown 8' and 'xdotool mouseup 8' when the buttons are pressed and released, respectively, but that didn't work.
Info:
My computer runs Arch Linux, with XOrg and KDE as my desktop environment. My kernel is linux-lts.
Link to the program, if you're curious