Reputation: 33
I'm using pygtk, gtk clipboard, and keybinder. Here's what I'm trying to do.
I'm catching the key strokes and popping up the window fine. I can copy to the clipboard. I can close the gtk app and return focus to the original windows text field. Only trouble is I don't know how accomplish step 4. As it is right now, the user has to then type ctrl-v to paste from the clipboard into the text field, I'd like to eliminate this keystroke.
Upvotes: 2
Views: 548
Reputation: 33
The best I could come up with was using python-wnck to get the window name, then copying to the buffer with gnome-clipboard, and then making a subprocess call to xdotool with the command and the window name.
paste_cmd = 'ctrl+v'
xdo_cmd = 'xdotool search "%s" windowactivate --sync key --clearmodifiers %s'
It seems to work but something native would of been better.
Upvotes: 1