stumpwm-devel
[Top][All Lists]
Advanced

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

Re: [STUMP] StumpWM and browser bookmarklets


From: Lionel Flandrin
Subject: Re: [STUMP] StumpWM and browser bookmarklets
Date: Tue, 3 Nov 2009 10:24:09 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

On Thu, Oct 29, 2009 at 10:58:14AM +0400, Dmitri Minaev wrote:
> Bookmarklets can be handy, but very uncomfortable to use in a
> basically mouseless environment, like StumpWM. Below is a simple Stump
> command which you might find useful -- it triggers a bookmarklet in
> the current window. It works in Opera, Firefox and Conkeror.
> Unfortunately, in the two latter browsers it works awkwardly: just
> pastes the URL into the address bar. It works, but slowly, and it may
> be a problem with the bookmarklets longer than the one I used. If you
> know a better way, let me know, please :)
[...]

For the paste issues you might try to use the XTest extension if your
clx implements it (cl:find-package :xtest). With it, you can send fake
key events that look real even to the X server, so you can trigger
special behavior such as pasting with mouse-2 or shift-insert.

For instance, in my RC I define the following command to paste the X
clipboard to the focused window:

(defcommand paste () ()
  "Simulate an S-Insert keypress on the focused window"
  (let ((shift-keycode
         (xlib:keysym->keycodes *display*
                                (keysym-name->keysym "Shift_R")))
        (insert-keycode
         (xlib:keysym->keycodes *display*
                                (keysym-name->keysym "Insert"))))
    (xtest:fake-key-event *display* shift-keycode t)
    (xtest:fake-key-event *display* insert-keycode t)
    (xtest:fake-key-event *display* insert-keycode nil)
    (xtest:fake-key-event *display* shift-keycode nil)))

StumpWM does the flushing by itself. It's of course much faster than
window-send-string and handles non-ascii characters (it's really
*exactly* equivalent to pressing shift-insert on your keyboard). It
will also bypass XTerm's disallowSendEvent.

-- 
Lionel Flandrin




reply via email to

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