Magic mouse for linux

Apple magic mouse on linux setup and how to guide

Using an apple magic mouse with linux is very easy: this post will show you how to setup an apple magic mouse on linux ubuntu, fedora, mint, etc. The apple mouse uses bluetooth to connect, so you need a bluetooth device (it may be built-in if you have a laptop). The bluetooth device needs to be switched on.

  • make sure bluetooth is enabled.
  • turn on your magic mouse
  • move the mouse.
  • you will see a ‘pair’ request
  • enter 0000 as the pair code.
  • you can now use your apple magic mouse on linux.

Troubleshooting your apple magic mouse on linux

If you dont get the pair request, click on the bluetooth icon and then click on the ‘+’ icon
Wait for the system to identify your magic mouse
Click the text thats displayed (it will say ‘apple magic mouse’)
You will now get a pair request and should be able to use your magic mouse

You Might Also Like

Read more about the article Ubuntu on the chuwi hi10 pro

Ubuntu on the chuwi hi10 pro

usb technology green microchip

March 20, 2017

snapcraft building arm snaps on raspberry PI

Read more about the article Mounting a harddrive from a western digital mybook NAS to recover data

January 11, 2021

Mounting a harddrive from a western digital mybook NAS to recover data

This Post Has 4 Comments

It keeps saying “searching for devices” – it’s been like this for over an hour and the mouse does not appear on the device list. What do i do?

Turninng the mouse off and on again to make sure it was in “discovery” mode helped me in your situation.

Источник

AppleMagicMouse

For Ubuntu 10.04 and 9.10 there is a driver for this device that is still under development, you can download it from the following address:

README

This code contains a Linux kernel driver for the magic mouse. Please see the INSTALL file for directions on how to use it with your kernel.

This code also contains three standalone programs:

hid-parse reads one or more input files (specified on the command line) that contain hexadecimal-formatted HID report descriptors, and prints out human-readable text forms of the descriptors. It should be considered fairly complete and stable.

mtalk talks to an Apple Magic Mouse (using L2CAP with the HID control and interrupt Protocol and Service Multiplexors [PSMs]) and prints human-readable forms of the messages that it receives. Typically the only command-line parameters you would pass are -r . It should be considered 85% complete.

usb-bt-dump reads a text dump in the format generated by Linux’s usbmon (e.g. /sys/kernel/debug/usb/usbmon/0u) to parse Bluetooth messages at various layers (HCI, L2CAP, etc) and print annotations with the parsed form. It is woefully incomplete and buggy and will probably not be maintained.

Читайте также:  Интеграция linux active directory

I wrote usb-bt-dump first, followed by mtalk, followed by hid-parse. mtalk is the only one that I expect to modify going forward.

INSTALLING THE MAGICMOUSE DRIVER

The Magic Mouse driver for linux is a module named hid-magicmouse.

Older kernels do not have all the hooks that a driver needs to talk to the Magic Mouse. These are provided in this directory; you must apply them and rebuild the kernel before you can load hid-magicmouse. To apply the patch series, change to your linux-2.6 directory, and run either:

OR (in a Bourne shell, such as /bin/sh):

for PATCH in *.patch ; do patch -p1 < $PATCH ; done

This series were cherry-picked from the HID and Bluetooth trees onto v2.6.32.8. They should be filtering from the HID and Bluetooth trees into the mainstream kernel between v2.6.33 and v2.6.34. This directory's hid-magicmouse.c should match the final result of applying the patches in sequence.

You will obviously need to reboot into the new kernel before the module can be loaded, but at that point user-space should see it as a normal input device, including a(n emulated) scroll wheel and middle button.

AppleMagicMouse (последним исправлял пользователь 87-194-16-171 2011-07-02 13:47:36)

The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details

Источник

What support does Ubuntu have for the Apple Magic Mouse? [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.

Does Ubuntu support the full functionality of the Apple Magic Mouse? What bluetooth adapters work best? What are the caveats?

This question appears to be abandoned, if you are experiencing a similar issue please ask a new question with details pertaining to your problem. If you feel this question is not abandoned, please flag the question explaining that. :)

2 Answers 2

Please see this to get help with MultiTouch in Ubuntu: https://wiki.ubuntu.com/Multitouch#Community%20Help

There is a section dedicated to the Apple Magic Mouse, I also have that device and am interested in documenting any multitouch information there.

The above page also includes information on testing and using demos for multitouch.

If you want to see the current gestures available in Ubuntu 10.10 you will need to install the Netbook edition (Unity). On a standard desktop you don't need to reinstall, just add the ubuntu-netbook package, logout, and login again making sure you choose Ubuntu Netbook Edition at the bottom of the login screen (after choosing your user).

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Connect Apple's Magic Mouse 2 with scrolling on Linux

Читайте также:  Linux перестала работать мышь

0xABAD/magic-mouse-2

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

These are my notes for getting Apple's Magic Mouse 2 with scrolling when connected to work with Linux. While I'm running Ubuntu 19.04 this should work with other distro's at it only involves udev which is standard with any modern Linux kernel.

DISCLAIMER: While I've used Linux off an on over the years, I am by no means an expert. I managed to get the Magic Mouse 2 working for me it might not work for you, and I most likely will not be able to assist you. Finally, while these instructions merely add a configuration file and shell script to your system, I take no responsibility for any damage that may occur on yours. As with anything you find on the internet. USE AT YOUR OWN RISK.

UPDATE: RicardoEPRodrigues has created a one stop shop that builds and installs the driver, necessary udev rules, and load script with a single install script. While this repo remains here for informational purposes your best bet is to checkout his work and not fuss with all these details.

Apple's Magic Mouse 1 works with Ubuntu out of the box (I tried with a co-worker's), Magic Mouse 2 on the other hand does not work completely (no scrolling) as it speaks a different protocol. Thankfully, someone has written a working driver that you can get from here:

From those instructions, you don't need DKMS nor do you need to run the install.sh script. Instead just build the kernel module:

cd Link-Magic-Trackpad-2-Driver/linux/drivers/hid make clean make 

Note that the repository will then have you unload the existing driver and load the one you just built which will cause your Magic Mouse 2 to work as intended. However, if you disconnect the mouse, reboot, reset bluetooth, etc. the driver will not be reloaded. I thought I would be clever and replace the existing driver on my system with this new one but everytime I reconnected the mouse the scrolling would not work and I would still have to manually reload the driver.

The work-around listed here is definitely a kludge and uses udev to run a script when the Magic Mouse 2 is connected via bluetooth. I would recommend checking out this tutorial about udev rules along with reading the man pages. Note that the tutorial is a bit old in internet years and refers to tools udevinfo , udevtest , udevcontrol , and udevtrigger . These should be replaced with udevadm info , udevadm test , udevadm control , and udevadm trigger respectively. The udevadm command is pretty handy and you should definitely check out the man page for it.

Читайте также:  Linux run file as user

The first thing to do is learn how to identify the Magic Mouse when it is connected. We can look at the output of tail -f ~/.local/share/xorg/Xorg.0.log while connecting the Magic Mouse 2 via Bluetooth and look for lines similiar to these:

[ 3821.555] (II) config/udev: Adding input device Magic Mouse 2 (/dev/input/mouse3) [ 3821.555] (II) No input driver specified, ignoring this device. [ 3821.555] (II) This device may have been added with another device file. [ 3821.686] (II) config/udev: Adding input device Magic Mouse 2 (/dev/input/event21) [ 3821.686] (**) Magic Mouse 2: Applying InputClass "libinput pointer catchall" [ 3821.686] (**) Magic Mouse 2: Applying InputClass "Magic Mouse 2" [ 3821.686] (II) Using input driver 'libinput' for 'Magic Mouse 2' 

The important line here is the config/udev: Adding input device Magic Mouse 2 (/dev/input/event21) or more specifically the /dev/input/event21 part. This acutal location may differ on your system. With this piece of information you can lookup the mouse's physical ID with udevadm info -a -p $(udevadm info -q path -n /dev/input/event21) . This will print out a lot of info but important part will look similiar to:

looking at parent device '//devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0/bluetooth/hci0/hci0:2$6/0005:004C:0269.0013/input/input654': KERNELS=="input654" SUBSYSTEMS=="input" DRIVERS=="" ATTRS=="Magic Mouse 2" ATTRS=="d0:c6:37:e4:5f:fb" ATTRS=="98:46:0a:ab:e2:e7" ATTRS=="0" 

It's the ATTRS=="d0:c6:37:e4:5f:fb" (your ID may differ) that will be used in a udev rule to identify the mouse inside a rule in the /etc/udev/rules.d directory. In that directory create a 10-magicmouse.rules file and add the following:

SUBSYSTEMS=="input", \ ATTRS=="d0:c6:37:e4:5f:fb", \ ACTION=="add", \ SYMLINK+="input/magicmouse", \ RUN+="/home/user_name/path/to/magic-mouse-2-add.sh" 

The 10- prefix was picked arbitrarily and could be any number as it is used to determine the lexical ordering of rules in the kernel. The earlier the file is loaded guarantees that the rule will be applied before any others. Ensure that the ATTRS contains the correct ID found from earlier and ensure that the RUN+= portion contains an absolute path to a script on your system. Don't use a relative path or ~ as the path is not interpreted by a shell and udev processes the path under root. With that place a shell script can be created at that location and should contain the following:

Replace the /home/user_name/path/to with the location of where you downloaded and built the Magic Mouse 2 driver. You can also adjust the scroll_speed to a value of your liking (somewhere between 0 to 63). If you wish to disable scroll acceleration or middle clicking with 3 fingers then set those values to zero. When this script is run it will unload the default Magic Mouse driver and then load the new one built eariler.

Now we need to reload the udev database with:

With that in place the Magic Mouse 2 will now be properly loaded with scrolling when connected via Bluetooth. Note that isn't perfect and sometimes the kernel will attempt to reload the driver several times every a few seconds. Also, your mouse may randomly disconnect at times but this was happening to me before applying this fix, may be related to a kernel battery power management issue, and something I am looking into.

About

Connect Apple's Magic Mouse 2 with scrolling on Linux

Источник

Оцените статью
Adblock
detector