2003-03-10 21:47:38 -05:00
|
|
|
;; Copyright (c) 2001-2003 by Norbert Freudemann, David Frese
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
;; *** grab the pointer **********************************************
|
|
|
|
|
|
|
|
(define-enumerated-type grab-mode :grab-mode
|
|
|
|
grab-mode? grab-modes grab-mode-name grab-mode-index
|
|
|
|
(sync async))
|
|
|
|
|
|
|
|
(define-exported-binding "scx-grab-mode" :grab-mode)
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2002-02-08 12:09:43 -05:00
|
|
|
(define-enumerated-type grab-status :grab-status
|
|
|
|
grab-status? grab-states grab-status-name grab-status-index
|
|
|
|
(success already-grabbed invalid-time not-viewable frozen))
|
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
(define-exported-binding "scx-grab-states" grab-states)
|
|
|
|
|
2003-05-01 17:05:33 -04:00
|
|
|
(import-xlib-function grab-pointer
|
2003-03-10 21:47:38 -05:00
|
|
|
(display grab-window owner-events? events ptr-mode kbd-mode
|
|
|
|
confine-to cursor time)
|
2001-08-22 08:06:41 -04:00
|
|
|
"scx_Grab_Pointer")
|
|
|
|
|
2003-05-01 17:05:33 -04:00
|
|
|
(import-xlib-function ungrab-pointer (display time)
|
2003-03-10 21:47:38 -05:00
|
|
|
"scx_Ungrab_Pointer")
|
|
|
|
|
2003-05-01 17:05:33 -04:00
|
|
|
(import-xlib-function change-active-pointer-grab
|
2003-03-10 21:47:38 -05:00
|
|
|
(display events cursor time)
|
|
|
|
"scx_Change_Active_Pointer_Grab")
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
;; *** grab pointer buttons ******************************************
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
(define-enumerated-type state :state
|
|
|
|
state? states state-name state-index
|
|
|
|
(shift lock control mod1 mod2 mod3 mod4 mod5
|
|
|
|
button1 button2 button3 button4 button5
|
|
|
|
state-13 state-14
|
|
|
|
any-modifier))
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
(define-exported-binding "scx-state" :state)
|
|
|
|
(define-exported-binding "scx-states" states)
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
(define-enum-set-type state-set :state-set
|
|
|
|
state-set? make-state-set
|
|
|
|
state state? states state-index)
|
2002-03-17 10:41:56 -05:00
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
(define-exported-binding "scx-state-set" :state-set)
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
(define-enumerated-type button :button
|
|
|
|
button? buttons button-name button-index
|
|
|
|
(any-button button1 button2 button3 button4 button5))
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
(define-exported-binding "scx-button" :button)
|
|
|
|
(define-exported-binding "scx-buttons" buttons)
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-05-01 17:05:33 -04:00
|
|
|
(import-xlib-function grab-button
|
2003-03-10 21:47:38 -05:00
|
|
|
(display button modifiers grab-window owner-events? events ptr-mode
|
|
|
|
kbd-mode confine-to cursor)
|
|
|
|
"scx_Grab_Button")
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-05-01 17:05:33 -04:00
|
|
|
(import-xlib-function ungrab-button (display button modifiers grab-window)
|
2003-03-10 21:47:38 -05:00
|
|
|
"scx_Ungrab_Button")
|
|
|
|
|
|
|
|
;; *** grab the keyboard *********************************************
|
|
|
|
|
2003-05-01 17:05:33 -04:00
|
|
|
(import-xlib-function grab-keyboard
|
2003-03-10 21:47:38 -05:00
|
|
|
(display grab-window owner-events? ptr-mode kbd-mode time)
|
|
|
|
"scx_Grab_Keyboard")
|
|
|
|
|
2003-05-01 17:05:33 -04:00
|
|
|
(import-xlib-function ungrab-keyboard (display time)
|
2001-08-29 10:43:49 -04:00
|
|
|
"scx_Ungrab_Keyboard")
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
;; *** grab keyboard keys ********************************************
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-05-01 17:05:33 -04:00
|
|
|
(import-xlib-function grab-key
|
2003-03-10 21:47:38 -05:00
|
|
|
(display keycode modifiers grab-window owner-events? ptr-mode kbd-mode)
|
|
|
|
"scx_Grab_Key")
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-05-01 17:05:33 -04:00
|
|
|
(import-xlib-function ungrab-key (display keycode modifiers grab-window)
|
2003-03-10 21:47:38 -05:00
|
|
|
"scx_Ungrab_Key")
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
;; *** release queued events *****************************************
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
(define-enumerated-type event-mode :event-mode
|
|
|
|
event-mode? event-modes event-mode-name event-mode-index
|
2002-02-08 12:09:43 -05:00
|
|
|
(async-pointer sync-pointer replay-pointer async-keyboard
|
|
|
|
sync-keyboard replay-keyboard async-both sync-both))
|
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
(define-exported-binding "scx-event-mode" :event-mode)
|
2002-02-08 12:09:43 -05:00
|
|
|
|
2003-05-01 17:05:33 -04:00
|
|
|
(import-xlib-function allow-events (display event-mode time)
|
2001-08-22 08:06:41 -04:00
|
|
|
"scx_Allow_Events")
|
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
;; *** grab the server ***********************************************
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; grab-server disables processing of requests and close downs on all
|
|
|
|
;; other connections than the one this request arrived on. You should
|
|
|
|
;; not grab the X server any more than is absolutely necessary. See
|
|
|
|
;; XGrabServer.
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-05-01 17:05:33 -04:00
|
|
|
(import-xlib-function grab-server (display)
|
2001-08-22 08:06:41 -04:00
|
|
|
"scx_Grab_Server")
|
|
|
|
|
2001-10-09 11:32:54 -04:00
|
|
|
;; ungrab-server restarts processing of requests and close downs on
|
|
|
|
;; other connections. You should avoid grabbing the X server as much
|
|
|
|
;; as possible. See XUngrabServer.
|
2001-08-22 08:06:41 -04:00
|
|
|
|
2003-05-01 17:05:33 -04:00
|
|
|
(import-xlib-function ungrab-server (display)
|
2001-08-22 08:06:41 -04:00
|
|
|
"scx_Ungrab_Server")
|