mouse actions when grab-keyboard...



hi everybody,

I have this "great" module for Sawfish: dmg-switch-window.jl	

http://turingmachine.org/hacking/sawfishLisp/

It is basically a quick way to switch windows with a regular expression.

The module works, but there is catch. I use a tablet and when the tablet
is in slate mode the mouse becomes useless, to the point that I can't
even exit the feature.

I use grab-keyboard, see snippet bellow. What I would like to know is if
there is a way to receive a keyboard event too (a simple way to exit
would be to receive a click). 

Thanks for any help

--dmg

P.S. My old X61t had a small keypad with arrows and that was very handy
to move from one window to another (the new X201 got away with it,
unfortunately).




(defun dmg-iswitch-get-window (switchable-windows)
  "Let user pick the last window used from a class with incremental search and return that window."
  (when (grab-keyboard)
    (unwind-protect
        (let* ((override-keymap '(keymap))
              (input "")
              (key "")
              (init-wlist (filter iswitch-filter-wlist-func switchable-windows))
              (focused-window (car init-wlist))
              wlist)
          (setq init-wlist (append (cdr init-wlist) (list focused-window))
                wlist init-wlist)
          (add-hook 'unbound-key-hook iswitch-read-event)
          (catch 'exit-iswitch
            (while t
              (display-message (iswitch-display-format input wlist)
                               `((font . ,iswitch-font)
                                 (background . ,iswitch-background-color)
                                 (foreground . ,iswitch-foreground-color)))
              (setq key
                    (catch 'iswitch-read
                      (recursive-edit)))
              (cond ((or (equal key "C-g")
                         (equal key "A-g")
                         (equal key "ESC"))



-- 
--
Daniel M. German                  
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]