You are not logged in.

#1 2012-02-21 18:22:37

d0lphchrist
Member
Registered: 2011-11-16
Posts: 8

[SOLVED] xbindkeys + xdotool timing problems

Hi,

I have strange problems when I try to bind a short xdotool-command via xbindkeys.
If I bind xdotool key a to a key, then xdotool generates no keyevent.
If I call xdotool key a directly, then it works.
If I bind sleep 1 && xdotool key a to a key, then it works.
If I bind xdotool key a && sleep 1 to a key, then xdotool generates no keyevent.

Anyone knows why there must be a little delay between the xbindkeys-event and xdotool?
Seems like the same thing works for other people.

The border between working and not working is a delay of ~100ms.

I'm using Compiz/Emerald 0.8.8 + XServer 1.11.4 + Ati Catalyst 12.1

Thanks for your time!

edit: same problem if I use xte "key a" instead of xdotool.
edit2: The problem seems to be related to the key-down time. If I press the key a shorter time than the command sleeps it works.
edit3: If I use another command like gvim it works without delay T_T'

Last edited by d0lphchrist (2012-02-21 21:38:11)

Offline

#2 2012-02-21 20:18:20

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] xbindkeys + xdotool timing problems

I use xbindkeys and xvkbd to type boilerplate code from short cut keys, so you could try that one. I haven't needed a delay yet.
No idea why you  need the delay though (xvkb does had a pause code built in so you can insert them into your strings if necessary).


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#3 2012-02-21 21:33:23

d0lphchrist
Member
Registered: 2011-11-16
Posts: 8

Re: [SOLVED] xbindkeys + xdotool timing problems

Thanks for your help.

I found the problem:
I was trying to bind Super_L + h,j,k,l to the arrow-keys to navigate like in vim while pressing the super-key.
Turns out that I needed to simulate a keyup-event for h,j,k,l before simulating the arrow-keys, so i changed to the command: xdotool keyup h && xdotool key Left

The only problem I have now is, that not any application likes the xtest-keyboard-events which xdotool generates.
Have you noticed such problems using xvkbd?

edit: This problem is related to the application-specific handling of modifier-keys. It works correctly with: xdotool key --clearmodifiers Left
This releases all modifier-keys (like shift, super, ...) before simulating the Left-key.

Last edited by d0lphchrist (2012-02-21 21:38:47)

Offline

#4 2012-02-22 09:15:10

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] xbindkeys + xdotool timing problems

Can't say if xvkbd does them any differently as I only use it for entering text, sorry.
I've only been using it a week or so, so haven't yet thought of any more sophisticated stuff to do with it yet.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

Board footer

Powered by FluxBB