I don't know if there is a way to grab the keyboard in windows or not, but
we should add to the logic in this function if there is.
-Bill P.
*** passwd.el~ Sat Jan 22 03:05:24 2000
--- passwd.el Sun Sep 10 00:03:03 2000
***************
*** 340,370 ****
(setq passwd-face-data (cdr passwd-face-data)))))
(defun passwd-grab-keyboard ()
! (cond ((not (and (fboundp 'x-grab-keyboard) ; lemacs 19.10+
! (eq 'x (if (fboundp 'frame-type)
! (frame-type (selected-frame))
! (frame-live-p (selected-frame))))))
! nil)
! ((x-grab-keyboard)
! t)
! (t
(message "Unable to grab keyboard - waiting a second...")
(sleep-for 1)
! (cond ((x-grab-keyboard)
(message "Keyboard grabbed on second try.")
t)
- (t
(beep)
(message "WARNING: keyboard is insecure (unable to grab!)")
(sleep-for 3)
nil)))))
(defun passwd-ungrab-keyboard ()
! (if (and (fboundp 'x-ungrab-keyboard) ; lemacs 19.10+
! (eq 'x (if (fboundp 'frame-type)
! (frame-type (selected-frame))
! (frame-live-p (selected-frame)))))
! (x-ungrab-keyboard)))
;; v18 compatibility
(or (fboundp 'buffer-disable-undo)
--- 340,376 ----
(setq passwd-face-data (cdr passwd-face-data)))))
(defun passwd-grab-keyboard ()
! ;; It is officially time to give up on lemacs 19.10
! ;; and just deal with device types.
! (let ((lock-func (case (frame-type)
! (x
! 'x-grab-keyboard)
! (gtk
! 'gtk-grab-keyboard)
! (otherwise
! nil))))
! (if (not lock-func)
! ;; There is nothing we can do...
! nil
! (if (funcall lock-func)
! ;; Grabbed it, hooray!
! t
(message "Unable to grab keyboard - waiting a second...")
(sleep-for 1)
! (if (funcall lock-func)
! (progn
(message "Keyboard grabbed on second try.")
t)
(beep)
(message "WARNING: keyboard is insecure (unable to grab!)")
(sleep-for 3)
nil)))))
(defun passwd-ungrab-keyboard ()
! (case (frame-type)
! (x (x-ungrab-keyboard))
! (gtk (gtk-ungrab-keyboard))
! (otherwise nil)))
;; v18 compatibility
(or (fboundp 'buffer-disable-undo)