I'm using MATLAB R2014a on my laptop running Ubuntu 14.04 LTS, and am experiencing a rather annoying issue. Whenever I use the two-finger scrolling gesture on my touchpad in either the editor or the main window, the following output appears in the command window:

MEvent. CASE!

While the scrolling works, this line is output over and over again as I continue to perform the gesture.

Any ideas for how to stop this from happening?

NOTE: It also occurs in Processing and Arduino IDEenter image description here

share|improve this question
up vote 19 down vote accepted

As a user I wouldn't want to type the above command everytime I open MATLAB. So I searched a bit on matlab 'startup' command line section, and the 'search path' section. I solved my problem after doing the following simple steps:

  1. See your userpath by typing userpath in MATLAB console: For linux it is: home/username/Documents/MATLAB/
  2. Create a file 'startup.m' having only one line, which will disable Mevent.CASE! (Below is the text to copy)

    !synclient HorizEdgeScroll=0 HorizTwoFingerScroll=0
    
  3. Place the created startup.m file in your userpath folder as defined in MATLAB.

  4. Now as soon as you place this file in your userpath, restart MATLAB.
  5. Verify by seeing ans = 0 in the workspace section.

It worked for me on Ubuntu 15.04 running MATLAB R2015b, I hope it works for you all as well.

Note: This is an improvement to @someDude and @Slothworks answer.

share|improve this answer
4  
This only works for Synaptics touchpads. – lindhe Mar 15 '16 at 7:24
    
I have just installed MATLAB R2016b. I placed the startup.m file into my home directory, and it seems to work. (For me userpath returns with "OxO empty char array". I have no /home/me/Documents directory. Being a Hungarian version of Ubuntu, the directory is called Dokumentumok.) – Arpad Horvath Oct 11 '16 at 12:17
    
this works sometimes, and other times doesn't – Arkya Chatterjee Dec 5 '16 at 15:24
    
A rather annoying drawback is the side-wise scrolling is dead after that and until a reboot. To fix that, you can add a file called finish.m to the same directory, with the following text: !synclient HorizEdgeScroll=1 HorizTwoFingerScroll=1 – Gallifreyan Jul 1 '17 at 19:04

None of these solutions worked for me. Moreover I like to keep the two finger scrolling. This works for me:

MATLAB relies on jdk7, jdk8 will not work with it. It appears 16.04 and later no longer provide openjdk-7-jre in the repos, and it must be installed from external sources. To install it:

sudo add-apt-repository ppa:openjdk-r/ppa  
sudo apt-get update   
sudo apt-get install openjdk-7-jdk

Ensure that you have correctly set the MATLAB_JAVA variable. This can be checked with:

echo $MATLAB_JAVA

If the output is empty, this variable is empty. It can be set with

export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk-amd64/jre

Then, execute MATLAB from the same shell with whatever command you use to call MATLAB, usually

matlab

In the MATLAB command window, run

version -java

and verify that the output contains "OpenJDK". If all is successful, you should no longer see the MEvent. CASE! error message.

To make this persistent: add

export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk-amd64/jre        

to the /etc/profile file (for system wide change) or to ~/.profile for local user

Source: https://www.reddit.com/r/matlab/comments/5anydi/how_to_stop_mevent_case_from_appearing/

share|improve this answer
2  
IMO this should be the correct solution, disabling the horizontal scrolling is not a real fix as it reduces functionality. Switching to a different JRE seems to fix the issue whilst maintaining horizontal scrolling. – Will Feb 23 '17 at 12:36
    
Thanks! This also works with linux clients that don't use libsynaptics. For those who migrate to wayland, which uses libinput by default, this may be the best or only way. – Trevor Apr 16 '17 at 20:43

Deactivating horizontal scrolling may fix the issue. Try running the following at the gnome-terminal:

synclient HorizEdgeScroll=0 HorizTwoFingerScroll=0

Or the following in the MATLAB console:

!synclient HorizEdgeScroll=0 HorizTwoFingerScroll=0

(source: http://www.mathworks.com/matlabcentral/answers/112528-mevent-case-when-two-finger-scrolling)

share|improve this answer
1  
Those are already the settings for me, and the bug occurs nevertheless. Anyone solved this problem recently? – zvezda Apr 14 '15 at 10:45

GNOME 3.20 ::SYNCLIENT IS OBSOLETE, Fixing the MEvent. CASE! error in MATLAB for xinput

The suggested solution is to run

!synclient HorizTwoFingerScroll=0

as part of your startup file to disable horizontal scrolling. This however does not work on more recent linux versions because the synaptics touchpad driver is being deprecated in favour of libinput. The new solution to this problem is slightly more complex however. First we need to find the id of the touchpad device with the xinput list command from a terminal (not the MATLAB command window). You should see something like:

~$ xinput list

⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=13   [slave  pointer  (2)]
⎜   ↳ ELAN Touchscreen                          id=11   [slave  pointer  (2)]

We are interested in the SynPS/2 Synaptics TouchPad which in this case has id=13. We can see the configuration options supported by this device by running :

~$ xinput list-props 13

Remember to change 13 to the id of the touchpad on your machine ! In the output you should see a line like:

Synaptics Two-Finger Scrolling (283):   1, 1

This tells you that two finger scrolling is enabled in the vertical and horizontal directions. To change this run :

~$ xinput set-prop 13 "Synaptics Two-Finger Scrolling" 1 0

If you couldn't find the "Two-Finger Scrolling" line all is not lost. Look for a line related to horizontal scrolling. In my case that was:

libinput Horizonal Scroll Enabled (266):    1

and the command used to disable this property is:

~$ xinput set-prop 13 "libinput Horizonal Scroll Enabled" 0

To have this run automatically every time you run MATLAB you can add

!xinput set-prop 13 "libinput Horizonal Scroll Enabled" 0

to your startup file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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