Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to map alt tab behavior to a mouse button using xdotool in my .xbindkeysrc. What I want to do is map something like

"xdotools keydown alt key Tab"
release b:7

but by doing this the alt key gets stuck, and it prevents my other mappings from working until I press the alt key on the keyboard. Is there a way to do this without having to press the alt key to get things unstuck? Without keydown it just switches back and forth between two windows, with keydown it behaves like I want (displaying the alt-tab switcher) but the alt key is stuck. Is there a way to unstick the key after using the alt tab switcher using xdotools?

share|improve this question
1  
I think you have to set the alt key to release too. –  Uri Herrera Apr 15 '12 at 3:25
    
@ fossfreedom I believe he means another invocation of xdotool. Like: xdotool keyup alt "simulation" because it is a simulation of the user doing something with the keyboard. –  user344200 Oct 31 at 7:06

2 Answers 2

"xdotool keydown alt key Tab; sleep 2; xdotool keyup alt"
b:7

The sleep interval allows me to access the menu and choose, and then it closes automatically. It's probably not the best solution but it works. If anyone has a better alternative please let me know. I find that xbindkeys only seems to work intermittentlly. It does not work on the overview (not for this command, but for a button tied to the super key. And after installing docky, I fnid that it does not work unless there is an open window available in the workspace. Odd behavior.

share|improve this answer

well, I think it over and found there is a workaround, you can just make another simulation to perform alt key release. This should be the most convenient way to simulate window switch with mouse gesture.

share|improve this answer
2  
... and for those of us who dont know what is a "simulation" and how to do this - perhaps you can explain this in your answer. Thanks. –  fossfreedom Sep 7 '12 at 15:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.