Patch to support horizontal mouse wheel

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Patch to support horizontal mouse wheel

Björn Winckler
Hi,

Attached is a patch to add horizontal mouse wheel support.  It may
look like a big patch, but the only real change is inside
gui.c/normal.c/edit.c (and it is quite minor, I had to modify some
horizontal scrollbar code and that's about it).  It applies to the
latest vim73 changeset as of today (i.e. the one titled "Added
":earlier 1f" and ":later 1f".").

Currently only GTK is supported but I can't test it since I don't
actually have access to GTK -- I have only tested the patch in MacVim
(but that code is not included in this patch).  Please let me know if
there are any problems with GTK.

I only added GTK support since it was completely straightforward -- I
leave adding support for other GUIs to whoever is interested (it
should be very easy).

One comment regarding the code: since vertical movement uses <MouseUp>
and <MouseDown> I named the horizontal keys <MouseLeft> and
<MouseRight> but I realize that this can be kind of confusing since
e.g. <LeftMouse> is used for clicking the left mouse button.  Should I
change the names?  To what?

I'm not sure how common it is to have horizontal mouse wheels on PCs
-- but pretty much every Mac comes with some form of horizontal
scrolling (e.g. trackpads on MacBooks or the Apple Magic Mouse) so
this patch is at least useful for MacVim users.  (I'd be happy if this
makes it into 7.3 -- in any case I will add it to MacVim 7.3 when I
release that)

Björn

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

horz-mouse-wheel.tar.bz2 (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Patch to support horizontal mouse wheel

Jordan Lewis-4
Hi Bjorn,

On Wed, Jun 30, 2010 at 12:43 PM, björn <[hidden email]> wrote:
...

One comment regarding the code: since vertical movement uses <MouseUp>
and <MouseDown> I named the horizontal keys <MouseLeft> and
<MouseRight> but I realize that this can be kind of confusing since
e.g. <LeftMouse> is used for clicking the left mouse button.  Should I
change the names?  To what?

...

Perhaps all of those identifiers should be changed to <MouseScrollFoo>. <MouseUp> for scrolling upward is just as confusing to me as <MouseLeft> for scrolling left.

This sounds like a nice and useful patch!

- Jordan

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Patch to support horizontal mouse wheel

Björn Winckler
On 30 June 2010 19:53, Jordan Lewis wrote:

> On Wed, Jun 30, 2010 at 12:43 PM, björn wrote:
>>
>> ...
>>
>> One comment regarding the code: since vertical movement uses <MouseUp>
>> and <MouseDown> I named the horizontal keys <MouseLeft> and
>> <MouseRight> but I realize that this can be kind of confusing since
>> e.g. <LeftMouse> is used for clicking the left mouse button.  Should I
>> change the names?  To what?
>>
>> ...
>
> Perhaps all of those identifiers should be changed to <MouseScrollFoo>.
> <MouseUp> for scrolling upward is just as confusing to me as <MouseLeft> for
> scrolling left.

I agree that <MouseUp> is also confusing but unfortunately that can't
be changed since it will break backward compatibility (it is possible
to bind to <MouseUp>).  Using <MouseScrollLeft> but then <MouseUp>
seemed even weirder to me which is why I chose <MouseLeft> even though
I dislike it.

Björn

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php