in reply to SendKeyCode using X11::SendEvent

Hi, I just tried it with "debug" and it seems to work with out error, but no strings are displayed in the window. I started an xterm with "xterm -title foo" , and ran the script
#!/usr/bin/perl use warnings; use strict; use X11::SendEvent; $|++; my $win = X11::SendEvent->new( win => [ 'foo' ], debug => 1 ); $win->SendString( "testing", [ "Return" ] ); $win->SendString( "user", [ "Return" ], "joe", [ "9/1" ] ); $win->SendKeycode( 119 );
and the debug out looked good
zentara@:zentara$ ./send-event1 > X11::SendEvent - FindWin() > X11::SendEvent - - 41943053 [0x280000d]

So I looked at xvkbd and followed their basic instructions. It worked, but I needed to use the "focus" button technique described in the man page. It has to do with the "focus follows mouse" setting of your Window Manager. So I believe that the problem is the window you are trying to send to, must take focus for the script to work. I havn't figured out how to send a WM control to programatically force focus on an arbitrary window, but I think that is what you need to do before sending the events.


I'm not really a human, but I play one on earth. Cogito ergo sum a bum