Previous: , Up: X Server   [Contents][Index]


59.2.3 Restricting Access to the Server by Other Apps

Function: x-grab-keyboard &optional device

This function grabs the keyboard on the given device (defaulting to the selected one). So long as the keyboard is grabbed, all keyboard events will be delivered to SXEmacs—it is not possible for other X clients to eavesdrop on them. Ungrab the keyboard with x-ungrab-keyboard (use an unwind-protect). Returns t if the grab was successful; nil otherwise.

Function: x-ungrab-keyboard &optional device

This function releases a keyboard grab made with x-grab-keyboard.

Function: x-grab-pointer &optional device cursor ignore-keyboard

This function grabs the pointer and restricts it to its current window. If optional device argument is nil, the selected device will be used. If optional cursor argument is non-nil, change the pointer shape to that until x-ungrab-pointer is called (it should be an object returned by the make-cursor function). If the second optional argument ignore-keyboard is non-nil, ignore all keyboard events during the grab. Returns t if the grab is successful, nil otherwise.

Function: x-ungrab-pointer &optional device

This function releases a pointer grab made with x-grab-pointer. If optional first arg device is nil the selected device is used. If it is t the pointer will be released on all X devices.