18

I am running Raspbian Jessie on Raspberry PI 2 Model B along with a touchscreen. I just noticed that whenever I use the touchscreen display, mouse pointer also follows my finger tips. I don't want that. I want to be able to permanently hide the mouse pointer whenever I am using the touchscreen and be able to get it back whenever I want the mouse pointer.

I keep reading about unclutter program to hide the mouse pointer, but it doesn't totally hide the mouse pointer. As long as you don't touch the screen or move the mouse, the mouse pointer is hidden by the unclutter program, but when you do it shows the pointer. At least that's what I read.

Any idea?

ThN
  • 1,063
  • 6
  • 22
  • 35
  • 2
    I've seen you on a similar question that i answered can you try running the following can you try running it like this starts -- -nocursor – Mohammad Ali Aug 05 '16 at 07:27
  • Yea, but it didn't work. – ThN Aug 08 '16 at 21:26
  • 2
    i meant to say startx -- -nocursor also, have you tried using unclutter and simply setting the time to zero? – Mohammad Ali Aug 08 '16 at 21:27
  • i read about unclutter and it says that it only makes the cursor disappear momentarily not permanently. If there is no mouse movement, pointer appears. If not, it disappears after sometimes. I don't want any mouse pointer at any one time just like on the smartphones. – ThN Aug 08 '16 at 21:31
  • can you try this: unclutter -display :0 -noevents -grab – Mohammad Ali Aug 08 '16 at 21:33
  • 2
    editing the /etc/lightdm/lightdm.conf file. Find the line which starts with xserves-command and edit it to start the X server without cursor. and make it look like this xserver-command=X -nocursor then reboot and startx – Mohammad Ali Aug 08 '16 at 21:43

4 Answers4

26

I simply added a nocursor option as follows in the file (/etc/lightdm/lightdm.conf)

xserver-command = X -nocursor

and it worked as it should. No cursor is displayed whatsoever. You can still put your finger on the touch screen and do what you normally do with your mouse pointer; Clicking and Dragging.

ThN
  • 1,063
  • 6
  • 22
  • 35
  • I do want to point out that this answer only seem to work on pitft DISPLAY raspberry pi operating system. I tried this on a regular raspberry PI operating system and it did not work for reason. – ThN Sep 18 '17 at 20:33
  • 11
    Make sure to add it at the bottom in the [Seat*] section, not above that. – brittohalloran Dec 06 '17 at 18:42
  • Didnt work on RPi Bullseye – A__ Jul 25 '23 at 21:02
  • @A__ What display are you using? like Pi approved touchscreen display or full up flat screen monitor? I have 7inch touchscreen display that is specifically meant to be used with Pi. This answer works on it. So, if you are using 3rd party's display, this answer may or may not work. I've been testing Bullseye and I have to agree that they have changed a lot, – ThN Jul 26 '23 at 18:30
  • Gotcha. Interesting that the external display is a factor. It's a third party display from ali express, definitely not Pi approved. – A__ Jul 26 '23 at 19:11
4

To work with any X server (I'm using the stretch version), Edit the /usr/bin/startx file and change the defaultserverargs line to: defaultserverargs="-nocursor"

1

An alternative would be to install unclutter and set it to idle 0:
This would disabled the mouse pointer when using a touch-screen.

sudo apt-get install unclutter
unclutter -idle 0

This could be made permantent by adding unclutter to the session:
vi ~/.config/lxsession/LXDE-pi/autostart
and add
@unclutter -idle 0

minni
  • 111
  • 2
  • I tried putting unclutter in autostart, and when it booted I didn't have a menu bar.

    Turns out it's EITHER local autostart (under ~/.config) OR systemwide, not both.

    I copied the system autostart into the local autostart. That worked and the menu bar is back.

    See:

    https://www.raspberrypi-spy.co.uk/2014/05/how-to-autostart-apps-in-rasbian-lxde-desktop/

    "Since v0.4.9 If both files are present, lxsession only executes the local file. This means you can no longer use both methods at the same time. Method 2 will take priority over Method 1."

    – Steven J Owens Jun 09 '22 at 22:41
0

If you use Raspbian Lite without X server, type:

export SDL1_VIDEODRIVER=“dispmanx” 

And run fuse.

The emulator gains performance, and the cursor is hidden.

Darth Vader
  • 4,206
  • 24
  • 45
  • 69