23

I've been trying to find a way to scroll the text horizontally with my scrollwheel in Eclipse, similar to the way you can do it in Textpad. In Textpad if you hold ctrl while you scroll vertically it will scroll horizontally. Does anybody know if there is a configurable setting somewhere in Eclipse that will allow this? I've looked all over the "keys" setting page without being able to find it, and Google/Stack Overflow searches haven't turned anything up for me.

Thanks.

6 Answers 6

3

I guess this depends more on your OS than on Eclipse. For instance on Mac OS it's Shift + Scrolling.

2
  • 1
    On a debian based linux distro this would work. Apr 23, 2014 at 10:32
  • it must be dependent on the OS but unfortunately this long awaited fix will now be available in eclipse 4.19 M3 likely as mentioned in the comment. Jul 19, 2021 at 5:06
3

@Daniel Sokolowski's answer was almost working. I have been using X-Mouse Button Control for over a year now and didn't know how to get the Horizontal Scrolling to work on certain programs (like Eclipse and Chrome) until I read Sokolowski's answer which pointed me in the right direction.

For the sake of brevity, and not to duplicate what has already been written clearly by Sokolowski, follow his directions, and in addition do the following:

  1. Add Eclipse to your Applications list in X-Mouse by clicking Add and finding javaw.exe in the "Choose Application" popup and clicking OK.
  2. Now click on the "Eclipse" profile and choose the "Scrolling & Navigation" tab
  3. Under the "Advanced Window Scrolling" choose Method 1(SCROLL Msg) option for Scroll Method
  4. Click Apply

enter image description here

If you correctly followed Sokolowski's and my instructions together you should be able to press Shift while scrolling up or down to trigger a horizontal scroll.

2

On a Windows machine this worked for me:

  1. Download X-Mouse Button Control
  2. In the main window go to 'Layer 2' and change 'Wheel Up' and 'Wheel Down' to 'Scroll Windows Right' and 'Scroll Window Left'
  3. Go into the 'Settings > Modifier Keys Tab' and select 'Shift' for the 'Activate Layer 2' setting.

Now in whatever active window, including Eclipse pressing shift and then scrolling up and down will scroll horizontally.

Update: I have been using this approach for a few days now and noticed that not all windows are horizontal scroll enabled, for example 'Package Explorer' is not but 'Navigator' is - this appears to be a limitation of Eclipse IDE rather than this approach. Please take a moment and upvote this Eclipse Bug #201984

enter image description here

1

You have a plugin supposed (not tested) to support horizontal scrolling.

But without plugin, SWT does not support horizontal scrolling on Windows.
Its support is planed for 3.6 though. (since 3.6M2, actually -- September 18, 2009)

New event constants have been added for horizontal mouse wheels.
See SWT.MouseHorizontalWheel and SWT.MouseVerticalWheel.

5
  • 1
    I tried installing this, but it doesn't look like it works. Are you saying it's not supposed to work because SWT doesn't support it on Windows yet? Also it was complaining that I didn't install it in an "Easyclipse" directory, is this supposed to work with an installation of the regular Eclipse IDE? Thanks for the suggestion, I'm going to keep messing around with it...
    – Greg
    Jan 22, 2010 at 18:08
  • @Greg: yes that plugin is for a special Eclipse distro I am not familiar with. SWT provides a common API for accessing native widgets across a spectrum of platforms, and it does not interpret correctly wheel messages on Windows before 3.6. Now, those messages are formerly designated and will be interpreted for all OS.
    – VonC
    Jan 22, 2010 at 18:13
  • 1
    eclipse 3.7 bug still not fixed, xD
    – max4ever
    Jan 30, 2012 at 9:42
  • @max4ever: according to bugs.eclipse.org/bugs/show_bug.cgi?id=279884, that feature should be there, even though it is unclear how the event is triggered (especially on Windows)
    – VonC
    Jan 30, 2012 at 9:50
  • i checked and it works in the panels like file explorer and others, but not in the editor where it is most needed
    – max4ever
    Jan 30, 2012 at 12:16
0

For me the best way while using eclipse or for that matter any IDE, is to have a new line char at the end of screen. I feel that to use horizontal scrolling to view data becomes bit difficult while going back and forth and I would like all code to be visible to me always. If the code you are trying to view requires you to use horizontal scroll bar then try to format it by using Ctrl+Shift+F.

3
  • I still feel formatting the code would solve your problem. This would be a one time effort as opposed to the struggle you are facing to view the code. Jan 22, 2010 at 18:14
  • 1
    @Greg, you can customize your code format. For example, force starting a line once the line exceeds 160 characters. Then add formatting your code into 'Save action'. While you save your java file, Eclipse will automatically format your code based on the rule you defined. It could be a workaround.
    – Kane
    Jan 30, 2012 at 10:24
  • 2
    Quite a poor idea. Most version control systems will decide that every single line was last modified by you if you use CTRL+SHIFT+F, and thus all lines in 'Blame' will point back to your autoformat operation. Not very useful and quite far off topic from what the poster requested. Feb 26, 2012 at 23:47
0

The bug has been fixed in the latest update of Eclipse.

In your Eclipse menu bar, simply:

1. Click Help>Check for Updates.. (and wait for the progress bar at the bottom to finish checking) 2. Install all updates.

Once Eclipse IDE gets restarted, you are now able to scroll horizontally.

(Save yourself from having to install additional mouse softwares to create new configurations. Phew, I'm so glad I figured this one out for myself)

Cheers!

1
  • Nope, it is still not fixed as of January 2022
    – Bogdan
    Jan 21, 2022 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.