1 ;;; xlib-xtest.el --- XTEST extension for xlib.
3 ;; Copyright (C) 2003-2005 by XWEM Org.
5 ;; Author: Zajcev Evgeny <zevlg@yandex.ru>
6 ;; Created: 18 October 2003
7 ;; Keywords: xlib, xwem
8 ;; X-CVS: $Id: xlib-xtest.el,v 1.5 2005-04-04 19:55:31 lg Exp $
9 ;; X-URL: http://lgarc.narod.ru/xwem/index.html
11 ;; This file is part of XWEM.
13 ;; XWEM is free software; you can redistribute it and/or modify it
14 ;; under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation; either version 2, or (at your option)
18 ;; XWEM is distributed in the hope that it will be useful, but WITHOUT
19 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
21 ;; License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with XEmacs; see the file COPYING. If not, write to the Free
25 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
28 ;;; Synched up with: Not in FSF
36 ;; * add X-XTestGetVersion, X-XTestCompareCursor, X-XTestGrabControl
42 (defconst X-XTest-op-GetVersion 0)
43 (defconst X-XTest-op-CompareCursor 1)
44 (defconst X-XTest-op-FakeInput 2)
45 (defconst X-XTest-op-GrabControl 3)
47 (defconst X-Xtest-KeyPress 2)
48 (defconst X-Xtest-KeyRelease 3)
49 (defconst X-Xtest-ButtonPress 4)
50 (defconst X-Xtest-ButtonRelease 5)
51 (defconst X-Xtest-MotionNotify 6)
53 (defun X-XTest-FakeInput (xdpy evtype detail root rootx rooty &optional time)
54 "On display XDPY send fake event of EVTYPE with DETAIL at TIME."
55 (X-Dpy-p xdpy 'X-XTest-FakeInput)
57 (let* ((test-ext (X-Dpy-get-extension xdpy "XTEST" 'X-XTest-FakeInput))
59 (list (vector 1 (nth 4 test-ext)) ; opcode
60 [1 X-XTest-op-FakeInput]
61 [2 (+ 1 (* 1 8))] ;length
66 [4 (or time X-CurrentTime)]
67 [4 (if (X-Win-p root) (X-Win-id root) root)]
73 (msg (X-Create-message ListOfFields)))
74 (X-Dpy-send xdpy msg)))
78 ;;; xlib-xtest.el ends here