Linux emulate bluetooth mouse

Использование Bluetooth-мышки в Linux

Недавно я приобрел Bluetooth-мышку для ноутбука. До этого все время пользовался проводными мышками, и отсутствие «хвоста» так понравилось, что захотелось приобрести беспроводную мышку и для настольного компа, когда текущую проводную доломаю (как ни странно, мышки у меня подолгу не живут, а зато клаве уже лет 6).

Но вопрос вот в чем. Чтобы использовать беспроводную мышку в ноутбуке, мне надо сначала с помощью тачпада кликнуть в системном трее на значок Bluetooth, выбрать эту мышку и в меню нажать Подключить. Т.е подключается она все равно вручную, а не при старте системы. В ноуте тачпад есть всегда, а как быть в этом случае с настольным компьютером?

Даже если и удастся решить эту проблему, вот еще какая может быть. Все ли LiveCD поддерживают Bluetooth мышки «из коробки» и подключают ее при старте системы? Мало ли, вдруг мне зачем-то понадобится запустить LiveCD с убунтой, к примеру. Или же все же держать на всякий случай проводную мышку наготове для таких случаев?

Apple Magic Mouse и Genius Travelmate 915 работают без сучка и задоринки. Инициирует соединение мышь при передвижении или первом щелчке, конечно, если она до этого была «спарена» с этим компом. Все дистры, что пробовал работали нормально.

А это только от самой мышки зависит или еще от Bluetooth модуля? Мне еще предстоит его докупать для настольного компа, причем выбрать еще так, чтобы поддержка конкретной модели модуля обязательно была обеспечена ядром, и не пришлось бы ставить дополнительных firmware.

Нерабочий из коробки БТ-модуль видел только на Mаках (перебивают ID чипа). Если предполагается работа одной мышки с двумя компами, то будут проблемы (предполагаю), т.к. мышь запоминает последнее устройство с которых коннектилась и будет долбиться к нему. Хотя, по стандарту они должны запоминать МАК-адреса 8 устройств.

Источник

Bluetooth mouse

This article describes configuration & troubleshooting steps specific to Bluetooth mice. The information here builds on the main Bluetooth article, and assumes the user has already followed any installation, configuration, or troubleshooting from that article.

Contents

Configuration

Apple Magic Mouse scroll speed

If the scroll speed is too slow, you can try

Scroll speed can be set from 0 to 63.

If the speed suits you, you can make the change permanent in /etc/modprobe.d/

Apple Magic Mouse middle click

If you find the middle click to be too finicky, you can disable it

If this setting suits you, you can make the change permantent in /etc/modprobe.d/

Mouse pairing and dual boot

When dual booting Windows and Linux, you may find yourself having to re-pair your Bluetooth mouse again and again. This will happen every time you switch OS, because when you pair your device, your Bluetooth service generates a unique set of pairing keys. And the core reason is that the set of pairing keys cannot be shared between the two OS.

First, your computer stores the Bluetooth device’s mac address and pairing key. Second, your Bluetooth device stores your computer’s mac address and the matching key. This usually works fine, but the mac address for your Bluetooth port will be the same on both Linux and Windows (it is set on the hardware level). However, when you re-pair the device in Windows or Linux, it generates a new key. That key overwrites the previously stored key on the Bluetooth device. Windows overwrites the Linux key and vice versa.

Читайте также:  Mac os big sur установка windows

To fix the problem, follow the instructions on [1].

if using a Bluetooth LE device use this python script, slightly edited to adapt for arch, originally discussed on [2].

Troubleshooting

Mouse lag

If you experience mouse lag you can try to increase the polling rate. See Mouse polling rate for more information.

You can try to set the minimum/maximum latency for the mouse in BlueZ [3]:

Add or modify the following section in /var/lib/bluetooth/mac-of-your-adapter/mac-of-your-mouse/info (adapt the path accordingly):

Also, you can use hcitool (in bluez-utils-compat AUR ) to change latency parameters of the device:

Note that this method is only effective for the current connection. If the mouse gets disconnected, you will need to execute again.

Alternatively, you can change the default latency settings via debugfs. See /sys/kernel/debug/bluetooth/hci0/conn__interval> .

This example will solve the lag problems, but you must un pair and pair the mouse:

Problems with the USB dongle

If you have trouble with your USB dongle, you may also want to try:

At this point, you should get an hci0 device with:

Sometimes the device is not active right away. Try starting the interface with:

and searching for devices as shown above.

Mouse always disconnects

If the mouse stops working but works again after restarting bluetooth, or the mouse seemingly keeps «falling asleep» after a couple of seconds of inactivity (which is the case for at least some models of Dell XPS 13 [4]), you may need to disable USB autosuspend for the selected device.

The issue may also lie in the device timeout and HID settings. See #Thinkpad Bluetooth Laser Mouse problems.

If you are using a Logitech device, this issue may be resolved by following the procedure in #Problems with the Logitech BLE mouse (M557, M590, anywhere mouse 2, etc).

Thinkpad Bluetooth Laser Mouse problems

If you are experiencing that your Thinkpad Bluetooth Laser Mouse rapidly connects and then (after a few milliseconds) disconnects again every few seconds (when you move the mouse or press a button), try pairing it with the code 0000 instead pairing without a code.

If the above is unhelpful, the issue may be in the device timeout settings. Edit/create the file /etc/bluetooth/input.conf and apply the following changes:

These changes will prevent device timeout in order to remain connected. The second setting enables userspace HID handling for bluetooth devices. Restart bluetooth.service to test changes. You also may need a reboot and to re-pair the device.

Kensington Expert Wireless Trackball problems

The Kensington Expert Wireless Trackball has default polling rates in the 200ms range, which make it laggy. To fix that, add or modify the [ConnectionParameters] section in /var/lib/bluetooth/mac-of-your-adapter/mac-of-your-mouse/info (adapt the path according to your mouse bluetooth address) as shown above, especially lower the latency to a small number or even 0 .

Problems with the Logitech BLE mouse (M557, M590, anywhere mouse 2, etc)

In some case, the mouse is paired but not moving when used. The device add to be trusted and unblocked. First of all open a terminal and run bluetoothctl

  1. Power off the bluetooth:
  2. Power on the bluetooth, then enable the pairing method on the mouse if needed:
  3. List the available bluetooth devices, you have to copy the mouse device ID XX:XX:XX:XX:XX:XX:
  4. Unpair the device if already paired:
  5. Put device in pairing mode (typically by long pressing a button, or a key combination on some keyboards). It will be detected by scan and displayed. Mind that the device ID may have changed (slightly), so copy the device ID shown by the scan.
  6. Trust the device:
  7. Pair the mouse with the computer:
  8. Connect the computer with the mouse:
  9. Unblock the device control:
  10. Power the bluetooth off and on.
Читайте также:  Активация windows server 2019 standard evolution

If the mouse does not work directly, just power off and power on the mouse.

In some cases, it may also be necessary to load the uhid kernel module.

Источник

Используем ноутбук как Bluetooth-клавиатуру (или мышь)

Только что пришла мне в голову мысль — можно ли подключить ноутбук по Bluetooth к телефону/планшету/etc, чтобы можно было печатать текст на компьютере, а передавались нажатия клавиш на мобильное устройство.

Оказывается, это уже реализовано в виде готовой программы, которую получилось достаточно быстро нагуглить по запросу linux emulate bluetooth mouse.

Называется она hidclient. Работает на Linux-компьютерах с Bluetooth.

Теоретически, передавать таким образом события с клавиатуры или мышки можно на любое устройство, которое поддерживает подключение HID-устройств по Bluetooth. На практике я попробовал это с iPod — прекрасно работает.

Итак, предположим, что у вас Ubuntu. Вам потребуются заголовочные файлы:

Далее загрузите исходики. Тут всё просто: нужно распаковать тарбол, перейти в директорию, в которую вы его распаковали, и выполнить make .

Внесите правки в /etc/bluetooth/main.conf:

  • DisablePlugins = input
  • Class = 0x000540

Запустите hidclient и подключитесь к вашему мобильному устройству. Это удобно делать через Bluetooth Manager (blueman-manager).

Кстати, если у вас несколько HID-устройств, то можно выбирать, какое именно вы хотели бы задействовать. То есть у вас может быть, например, подключено сразу две клавиатуры — с одной события будут использоваться только компьютером (X-сервером), а с другой только мобильным устройством.

Желаю всем приятно провести время в консоли, и хороших выходных!

Источник

подключение мышь по bluetooth

Привет! Есть мышь и БТ-адаптер, специально приобретенный для реализации предыдущего топика. В характеристиках заявлена поддержка линукс, но сходу подключить не удалось, делал по этому ману, в lsusb адаптер виден, служба БТ включена, но дальше, что-то не алё.

пробовал запустить blueman-tray, но он ругается на libappindicator, blueman-manager тоже не запускается(
команда hidd из мана не найдена в системе, и пакет её содержащий я не нахожу.
Подскажите что я упускаю? Куда еще копать?

Надо перевести мышь в режим подключения, по инструкции от производителя. Пока не переведешь, она не будет видна.

это я делал, бес толку, на всякий случай еще включил БТ на 2-х телефонах и часах, ничего не видит

Я почитал тред по ссылкам, и по-моему, у тебя вообще не BT-мышь.

фото и на ноуте с вин10 по БТ она подключалась

Ок, тогда претензия отпадает.

А что там с телефонами? Телефоны не видны с компьютера, или к ним тоже не подключается мышь? По идее, мышь должна работать с андроидом без бубна.

для начала надо запустить адаптер, но пока не взлетает(

Да, телефоны не видны с компьютера.
я к телефону мышь не собираюсь подключать, но только что проверил, телефон ее не видит, а вот с другого телефона видит какое-то устройство с макадресом с4:22:17: и тд и сопряжение происходит, но дальше я хз что с ним делать в телефоне…

Читайте также:  Изменение системных иконок windows

А телефон как подключаешь? Современные версии андроида сами видны только когда ты выбираешь пункт «Добавить устройство». Очень очевидное поведение, да.

на обоих телефонах есть меню «доступные устройства» и там список того к чему могу подключиться

Я имею ввиду, ты нажимаешь на телефоне «добавить устройство», чтобы телефон начал искать другие устройства, и в этот момент ищешь телефон с компьютера, через hcitool или еще как-то. Он в этот момент должен быть виден.

так адаптер не стартует, ничего не показывает
screenshon

hciconfig hci0 up?

У меня заканчиваются идеи. Возможно, нужно поставить firmware, без которого оно работать не хочет.

а Dmesg читать не пробовали?

Cambridge Silicon Radio, Ltd Bluetooth Dongle

Он же на чипе CSR8510 A10? У меня точно такой же. Только там не v5.0, а v4.0. Таких проблем нет. Работает отлично.

Настраивать нужно именно bluetoothctl (входит в bluez). С другими утилитами могут быть проблемы.

Сервис bluetooth точно запущен? Какой именно GNU/Linux установлен?

Возможно, нужно поставить firmware, без которого оно работать не хочет

Нет. Это же CSR. Работает со свободным драйвером.

Источник

Muddy Boots

photography, computing, scientific research, and other ramblings by Johann A. Briffa

Using a Microsoft Bluetooth Mouse on Ubuntu 16.04 LTS

Today’s blog post is a bit of a note to self. As usual, I had solved this problem once before, but had to repeat a fair bit of work to solve it again on another box. So I thought I should really write it up, for future reference.

Over the last several weeks I have been working through some long-awaited upgrades to my home PC. This involved performance upgrades (the usual mainboard, CPU, RAM combo), quietness upgrades (basically I replaced all the fans with lower-noise Noctua fans for a very significant improvement), and human-interface upgrades (mice and keyboards). Most of the process was fairly straight forward, so I’ll spare you the details there. With the mice, however, I hit a few snags (which I must say were not unexpected).

Background

The problem at hand is how to pair recent Microsoft Bluetooth mice with an Ubuntu box, and get them to work. This applies at least to the following models:

  • Microsoft Arc Touch Bluetooth Mouse
  • Microsoft Designer Bluetooth Mouse
  • Microsoft Surface Mouse (which looks suspiciously like the Microsoft Modern Mouse)

I have each of the above models, and this solution has been tested with all of them. (The first model is what I use as a portable mouse with my Surface; the others are intended for my desktop, which has a dual-seat setup.)

The difficulty is that, with an out-of-the-box Ubuntu setup, the mice will pair but will not work.

Solution

First of all, you’ll need a bluetooth adapter that supports the 4.0 LE standard or later. You can check what standard your system supports by running the following command:

The Bluetooth version is listed under “HCI Version”. Next step involves editing a couple files in the system:

  • /lib/udev/rules.d/50-bluetooth-hci-auto-poweron.rules
    • Comment out the only non-commented line
  • /etc/bluetooth/main.conf
    • Uncomment the lines with “[Policy]” and “AutoEnable=true” (the latter one needs to be edited)

Reboot, and pair the mouse. At this point it should work, but if not, try un-pairing and re-pairing once (in some cases this may be necessary).

Just to make life more interesting, the web page where I had found the solution originally (when pairing the Arc Touch with my Surface) seems to be offline. Thankfully, the web archive has a copy.

Источник

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