I just set up my Ubuntu desktop to use our living room TV as a monitor, and I would like to be able to use either my iPhone or Nexus 7 tablet as a mousepad/keyboard for controlling it from the couch. With Mac/Windows there were plenty of apps that did this, what do I need to do this using Ubuntu? And just to be clear I am NOT looking for a Remote Desktop on my phone/tablet, I want to use them as a mouse and keyboard. Thanks!
Ubuntu – How to use the phone or tablet as mousepad
iphonemousenexus-7remote
Related Solutions
Following Grumbel's answer, I tried *xboxdrv
solution with the support of this website and especially this page:
Install xboxdrv 0.8.2 from Ubuntu Software Center.
Install also uinput and joydev if needed. I did it this way:
sudo modprobe uinput sudo modprobe joydev
Need to know the event of the gamepad:
Launch
udevadm monitor --udev
and then plug the game pad:$ udevadm monitor --udev monitor will print the received events for: UDEV - the event which udev sends out after rule processing UDEV [6722.377700] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1 (usb) UDEV [6722.383264] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0 (usb) UDEV [6722.383333] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/0003:046D:C218.0003 (hid) UDEV [6722.383389] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/0003:046D:C218.0003/hidraw/hidraw1 (hidraw) UDEV [6722.387123] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/input/input10 (input) UDEV [6722.399284] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/input/input10/event8 (input) UDEV [6722.412128] add /devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/input/input10/js0 (input)
I conclude that my gamepad's event is
/dev/input/event8
Display names of every key, axis, button of the gamepad.
The idea is to launch
xboxdrv
and test every button and note the result on paper.$ sudo xboxdrv --evdev /dev/input/event8 --evdev-debug Your Xbox/Xbox360 controller should now be available as: /dev/input/js1 /dev/input/event9 Press Ctrl-c to quit, use '--silent' to suppress the event output EV_ABS ABS_X 128 EV_ABS ABS_Y 128 ...
In my case the result is:
Set the config file
Create an
xboxdrv-mouse.ini
file to set X Y axis and left and right mouse button.Here I set gamepad buttons 2 for left mouse button and 3 for right mouse button:
[xboxdrv] evdev=/dev/input/event8 silent=true [evdev-absmap] ABS_X=x1 ABS_Y=y1 [ui-axismap] x1=REL_X:10 y1=REL_Y:-10 [evdev-keymap] BTN_THUMB=a BTN_THUMB2=b [ui-buttonmap] a=BTN_LEFT b=BTN_RIGHT # EOF #
Note that value for
REl_X
andREL_Y
seems to define the speed of the mouse, and by defining a negative value it inverts the axis (see here forREL_Y
)Another example with more button definition
[xboxdrv] evdev=/dev/input/event8 silent=true [evdev-absmap] ABS_X=x1 ABS_Y=y1 ABS_HAT0X=x2 ABS_HAT0Y=y2 [ui-axismap] x1=REL_X:10 y1=REL_Y:-10 x2=KEY_LEFT:KEY_RIGHT y2=KEY_DOWN:KEY_UP [evdev-keymap] BTN_TRIGGER=x BTN_TOP=y BTN_THUMB=a BTN_THUMB2=b BTN_PINKIE=rt BTN_BASE2=rb BTN_TOP2=lt BTN_BASE=lb BTN_BASE3=back BTN_BASE4=start [ui-buttonmap] x=KEY_KPENTER y=KEY_SPACE a=BTN_LEFT b=BTN_RIGHT rt=KEY_KP8 rb=KEY_KP2 lt=KEY_KP6 lb=KEY_KP4 back=KEY_LEFTSHIFT start=KEY_RIGHTCTRL # EOF #
Launch it
sudo xboxdrv --config xboxdrv-mouse.ini
To avoid launching it with
sudo
, create a udev rule.
CONCLUSION
It works fine, it's the best solution for me.
This is currently the best solution I found, although I think at this time, its smooth scrolling feature is not yet useable. In future, native, driver-based solutions have to be made to support mice and touchpads which support smooth scrolling. Especially on a desktop system like Ubuntu.
Solaar
There is an application called Solaar which offers many possibilities to unifying-devices from Logitech, like battery status, pairing options (awesome!) and smooth scrolling. Unfortunately, smooth scrolling does not work that great; it does not scroll as smoothly as on OS X, and it only scrolls the last active window, not the mouse-overed window (tested on 13.04). But it's in every way a useful application and its smooth scrolling feature is something I hope gets improved with future updates.
Homepage: http://pwr.github.io/Solaar/
Installation
Open a Terminal via the Unity dash or CTRL+ALT+T and paste in the following lines:
sudo add-apt-repository ppa:daniel.pavel/solaar
sudo apt-get update
sudo apt-get install solaar
Usage
- Start Solaar via the Unity dash, for example.
- If you see a popup recommending to replug the unifying-receiver, do it.
- There should appear a tray icon looking like a battery. If you open it and click on a device, you'll see information about your devices.
- On the right of the entry for your mouse should be a settings icon. Click it and a "smooth scrolling" option should appear.
- Try it, it's easy to disable again in case it does not work for you.
- If you experience problems like the horizontal scrolling does not work, try replugging the receiver again.
Best Answer
I use remotedroid. You just need to install the client on your tablet, and then connect to the local IP of your running server. It sends mouse movements, left and right click and typing. The server doesn't even need installation, is a simple .jar archive. To run it:
Here you can download the server (the client is in the market):
http://www.remotedroid.net/