3

Linux newbie here.

I have installed my first Linux machine, a to be HTPC running Ubuntu desktop 20.04 LTS. For convenience I am looking into ways of interacting without having to take out a keyboard.

Therefore I have installed Unified Remote server (in order to use my android phone or tablet to interact with the machine) and using Bluetooth to connect to it, using the last summarized answer in this thread:

Unified Remote: Bluetooth: Could not connect to SDP

Which worked well, the server now autostarts, and connecting via Bluetooth is working properly as far as I can tell. (have tried two different devices)

However, the app itself (Unified Remote) behaves somewhat strange. I can move the mouse cursor fine, also do commands like scrolling and long-pressing (e.g. for marking text). But not Left click or Right click.

I have not tried extensively other remotes in the app (there are presets for media playback, presentations, etc), but from the basics alone it is the Left and Right click that is not working.

The makers of the app had no concrete idea, only suggesting that 'there are many different Linux dists/builds', i.e. perhaps try another in order to investigate.

I hope someone has ideas for what to try, or how to verify that Bluetooth in itself is working as intended.

2
  • Addition, I've run something called 'xinput -test ID', where ID is the number of the Unified remote mouse. As described above, and in accordance, movements are registred as well as scrolling. But nothing happens Left or Right clicks.
    – Freppa
    May 27 '20 at 17:05
  • Furthermore, text input through the app works somewhat, but there I am not really sure what to expect in terms of behavior.. Entering a 'enter' after typing the password for login for example, does not work (even though the actual letters of the password are transmitted ok).
    – Freppa
    May 27 '20 at 17:11
1

I ran into this issue a while ago and found a way to make it work. I don't know exactly why this is a problem, but for me the issue is the mouse.click action used by UnifedRemote doesn't work. But fortunately, both the mouse.down and mouse.up actions do!

So if you're up for making some code changes, you can edit the mouse remote (make sure to make a backup copy of the file beforehand!) and replace the mouse.click actions with both mouse.down and mouse.up. I'm not sure exactly which remote file corresponds to the actual mouse remote, but it's probably either /opt/urserver/remotes/Unified/Core/Mouse/remote.lua or /opt/urserver/remotes/Unified/Core/Input/remote.lua.

I actually made a custom mouse remote to do this, you can find some tutorials for creating custom remotes here: https://www.unifiedremote.com/tutorials/tags/Custom%20Remotes

3
  • Thanks for this hint. I tried to edit /opt/urserver/remotes/Unified/Core/Mouse/remote.lua as well as /root/.urserver/remotes/bundled/Unified/Main/'Basic Input'/remote.lua but had no luck with adding any mouse.down(); mouse.up(); or update("tap");... any ideas on how to fix this? Btw: clicking works if tapping for ~1s (not too short and not too long), but it's really not intuitive
    – F1iX
    Feb 7 '21 at 14:17
  • 1
    @F1iX I went back and looked at my setup to get a little more detail. As far as I can tell, none of the lua files provided will actually change the behavior of the default mouse remote. I'm not sure where/how that remote is defined. What I did was copy the entire folder at Unified/Main/'Basic Input' into a new custom remote (see instructions here: unifiedremote.com/tutorials/how-to-install-a-custom-remote) and gave it a new name. Then I edited the copied lua file, and added the new custom remote in the app. Hopefully that will work for you too!
    – Ben
    Feb 9 '21 at 16:25
  • Thank you so much, Ben! I finally got it working and posted the full solution here :)
    – F1iX
    Feb 13 '21 at 20:36
1

Thanks to Ben's answer and his valuable reply to my comment, I finally got this working:

  1. Indentify the local path for your remotes via http://<unified-server-address>:9510/web - Settings - Remotes - Paths. In my case the path was /root/.urserver/remotes
  2. Copy the 'Basic Input' remote to the custom directory in the aforementioned path, e.g.:
    sudo cp -r /opt/urserver/remotes/Unified/Main/Basic\ Input/. /root/.urserver/remotes/custom/PiInput
    
  3. Adapt meta.name and meta.id in /root/.urserver/remotes/custom/PiInput, e.g. calling the new remote PiInput.
  4. Replace the click functionality in the tap, left and right events by mouse.down() and mouse.up() as suggested by Ben:
    actions.tap = function ()
        update("tap");
        if (dragging) then
            dragging = false;
            mouse.dragend();
            mouse.up();
        else
            mouse.down();
            mouse.up();
        end
    end
    actions.left = function ()
        mouse.down();
        mouse.up();
    end
    actions.right = function ()
        mouse.down("right");
        mouse.up("right");
    end
    
  5. Reload the remotes in the web interface (http://<unified-server-address>:9510/web) and/or restart the server.
  6. Use your newly created remote and enjoy intuitive mouse click behavior with Unified Remote on your Raspberry Pi :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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