scx/scheme/xlib/grab.scm

108 lines
3.5 KiB
Scheme
Raw Normal View History

;; Copyright (c) 2001-2003 by Norbert Freudemann, David Frese
2001-08-22 08:06:41 -04: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
(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))
(define-exported-binding "scx-grab-states" grab-states)
(import-lambda-definition grab-pointer
(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")
(import-lambda-definition ungrab-pointer (display time)
"scx_Ungrab_Pointer")
(import-lambda-definition change-active-pointer-grab
(display events cursor time)
"scx_Change_Active_Pointer_Grab")
2001-08-22 08:06:41 -04:00
;; *** grab pointer buttons ******************************************
2001-08-22 08:06:41 -04: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
(define-exported-binding "scx-state" :state)
(define-exported-binding "scx-states" states)
2001-08-22 08:06:41 -04:00
(define-enum-set-type state-set :state-set
state-set? make-state-set
state state? states state-index)
(define-exported-binding "scx-state-set" :state-set)
2001-08-22 08:06:41 -04: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
(define-exported-binding "scx-button" :button)
(define-exported-binding "scx-buttons" buttons)
2001-08-22 08:06:41 -04:00
(import-lambda-definition grab-button
(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
(import-lambda-definition ungrab-button (display button modifiers grab-window)
"scx_Ungrab_Button")
;; *** grab the keyboard *********************************************
(import-lambda-definition grab-keyboard
(display grab-window owner-events? ptr-mode kbd-mode time)
"scx_Grab_Keyboard")
(import-lambda-definition ungrab-keyboard (display time)
2001-08-29 10:43:49 -04:00
"scx_Ungrab_Keyboard")
2001-08-22 08:06:41 -04:00
;; *** grab keyboard keys ********************************************
2001-08-22 08:06:41 -04:00
(import-lambda-definition grab-key
(display keycode modifiers grab-window owner-events? ptr-mode kbd-mode)
"scx_Grab_Key")
2001-08-22 08:06:41 -04:00
(import-lambda-definition ungrab-key (display keycode modifiers grab-window)
"scx_Ungrab_Key")
2001-08-22 08:06:41 -04:00
;; *** release queued events *****************************************
2001-08-22 08:06:41 -04:00
(define-enumerated-type event-mode :event-mode
event-mode? event-modes event-mode-name event-mode-index
(async-pointer sync-pointer replay-pointer async-keyboard
sync-keyboard replay-keyboard async-both sync-both))
(define-exported-binding "scx-event-mode" :event-mode)
(import-lambda-definition allow-events (display event-mode time)
2001-08-22 08:06:41 -04:00
"scx_Allow_Events")
;; *** 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
(import-lambda-definition 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
(import-lambda-definition ungrab-server (display)
2001-08-22 08:06:41 -04:00
"scx_Ungrab_Server")