stumpwm-devel
[Top][All Lists]
Advanced

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

Re: [STUMP] Mouse mode first shoot


From: Philippe Brochard
Subject: Re: [STUMP] Mouse mode first shoot
Date: Mon, 27 Mar 2006 23:19:43 +0200
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Shawn Betts writes:

> Philippe Brochard <address@hidden> writes:
>
>> Shawn Betts writes:
>>
>>> Philippe Brochard <address@hidden> writes:
>>>
>>>> Hi everyboy,
>>>>
>>>> Here is a first shoot for the mouse mode :)
>>>
>>> This code looks pretty good!
>>>
>>> I'll have to give this patch some thought before I put it in CVS. But
>>> I'm fairly certain its not a bad thing.
>>>
>> Yes, but I think that a better way is to change the
>> parse-and-run-command function to accept mouse-event (like :frame,
>> :string...) function insteed of using the global variable
>> *current-event*.
>
> Ah, you're saying clicking a frame would could supply a command with a
> frame argument? Perhaps a :frame-click type that'd wait for the user
> to click a frame?
>
> I think I like that idea.
>
Yes, a thing like this.

> Another possibility that would perhaps work well for your mouse event
> stuff is to incorporate mouse clicks like they are keypress like
> emacs: <down-mouse-1>, etc. Then perhaps add a :click command argument
> that would be an x,y coordinate of where the mouse was clicked.
>
> So you could do something like this:
>
> (define-stumpwm-command "click-focus-frame" (screen (click :click))
>   ;; find the frame clicked in based on CLICK
>   )
>
This is just what I mean :)

> (define-key *root-map* (kbd "<mouse-down-1>") "click-focus-frame")
>
> or perhaps
>
> (define-key *top-map* (kbd "C-<mouse-down-1>") "click-focus-frame")
>
Yes, if this is possible, I really like that (but this mean to rewrite
a lot of stumpwm internal code).

I think the *root-map* is a good candidate: when you press C-t,
you wait for a keypress as usual and you grab mouse events as you have
said just above. But, only a keypress or a mouse-button-1 (or a
special value returned by the stumpwm command) make stumpwm
leave the event loop (so multiple mouse event can be made)
So, C-t enter the mouse mode (instead of C-t C-x in my mouse.lisp).

I don't like the *top-map* because unless you're in mouse mode, all
mouse event doesn't have to be grabbed.



Philippe

-- 
Philippe Brochard    <address@hidden>
                      http://hocwp.free.fr

-=-= http://www.gnu.org/home.fr.html =-=-




reply via email to

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