stumpwm-devel
[Top][All Lists]
Advanced

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

[STUMP] fselect to support >10 frames


From: John Li
Subject: [STUMP] fselect to support >10 frames
Date: Tue, 24 Jun 2008 01:28:37 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

stumplings,

I'm working on changing fselect to allow the user to select frames
with 2 digit numbers. I changed get-frame-number-translation to
display the entire number (instead of just the first char) and changed
choose-frame-by-number to call a new function "read-n-chars" instead of
"read-one-char".

(defun read-n-chars (n screen)
  "Read n characters from the user."
  (with-focus (screen-key-window screen)
    (let ((string nil))
      (dotimes (count n)
        (let* ((k (read-key-no-modifiers))
               (c (keycode->character (car k) (xlib:make-state-keys (cdr k)))))
          (when (char= c #\Space)
            (return-from read-n-chars string))
          (setf string (concatenate 'string string (string c)))))
      string)))

read-n-chars takes an integer argument for how many chars to read
(choose-frame-by-number passes the number of digits of the
highest-numbered frame). If there are frames 0 through 15, it will
read 2 chars. If the user enters 10 through 15, the frame is
selected. However, if the user wants to select one of the single
digits frames, they have to type the single digit then space. I think
this is reasonable behavior.

Now:
1. How do I add the ability to "C-g" out of the selection?
2. How do I add RET to end the read, like #\Space does? Neither
#\Newline nor #\Return work.

Besides these 2 issues, I think the addition is mostly complete. Any
comments? If you wonder about the utility of this, try using stumpwm
on 3 or more screens[1] :).

 http://circularly.org/tmp/stumpwm-dmx.jpg
 http://circularly.org/tmp/stumpwm-dmx5.jpg
 (the second is a horrible picture, sadly)

Thanks,
John




reply via email to

[Prev in Thread] Current Thread [Next in Thread]