Injecting keypress into a window



Hi,

I'm attempting to use Sawfish for 'advanced' window management, and I
would like to inject keypress events into a window.
'send-client-message' seems to be what I need, but I'm not clear on the
type required.  Here's what I've got so far:

(defun ag-dummy-press ()
  (interactive)
  (dolist (w (managed-windows))
    (when (string-match "^Event" (window-name w))
      (format standard-output "Got match on %s\n" (window-name w))
      (send-client-message w 'KeyPress
			   (vector (x-atom 'KeyPress) 78) 
			   32))))

However applying this to an xev window only gives the following:

        ClientMessage event, serial 28, synthetic YES, window 0xa00001,
            message_type 0x1ba (KeyPress), format 32

Obviously I'm no X guru, can someone with more expertise show me where
I'm going wrong?

Thanks,
Steve





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]