!ttKPgmaucSQTHmGurC:gitter.im

termux/termux

8729 Members
General discussions about Termux, talk about your fancy setup, etc. Please keep off-topic talks minimum. General Termux community rules apply: https://wiki.termux.com/wiki/Community#Rules238 Servers

Load older messages


SenderMessageTime
23 Jan 2025
@_discord_195768637427154944:matrix.termux.clubSartekSorry I meant configuration option, I just realized it doesn't appear that termux has a preferences or settings interface which was where I was thinking it would make sense to be. Only the termux x11 app.05:53:40
@ted:rudebat.ioted Sartek topics of configuration options and dead zones may be premature 05:55:15
@ted:rudebat.iotedgiven the functionality doesn't exist yet05:55:24
@_discord_1186249674357743656:matrix.termux.clubFZXOuse xinput06:08:46
@_discord_1186249674357743656:matrix.termux.clubFZXO* use xinput bridge06:08:52
@_discord_722419788034474004:matrix.termux.clubtwaikIt will not be a preference/setting too. It will be a command for passing LD_PRELOAD and stuff to subsequent commands.06:08:53
@_discord_1186249674357743656:matrix.termux.clubFZXOIt's an app like input bridge but for controllers06:09:11
@_discord_195768637427154944:matrix.termux.clubSartek Yeah, I was more trying to explain that translating controller input to mouse and keyboard can quickly become a mess and really isn't an elegant solution but could be hacked together. The issue with getting real controller input is that without root you can't create a device in the correct location that almost every single Linux application checks for controllers as you simply do not have the permissions on Android to do that. What you most likely have to do is override the normal executables behaviour to attempt to search for controller input devices in the usual place and have it instead access a virtual device in a place that android without root does have the permissions too. I believe Android has security that prevents game controller input being sent to an Android application unless it is in focus as we are using termux x11 that would then have to send it to the termux process in the background with whatever method is available further complicating it before termux then "emulates" a controller device in what the executable program thinks is /dev/input/js0 06:11:58
@_discord_195768637427154944:matrix.termux.clubSartekYeah I've heard of it but it's closed source and I don't feel comfortable using it on my main phone from a security perspective.06:13:20
@_discord_930439396560347168:matrix.termux.clubhardray

seems like it's open source
https://github.com/Ilan12346-maya/XinputBridge

Inputbridge is close source tho

06:22:00
@_discord_930439396560347168:matrix.termux.clubhardray *

seems like it's open source
https://github.com/Ilan12346-maya/XinputBridge

Inputbridge is close source tho

06:22:01
@_discord_930439396560347168:matrix.termux.clubhardray *

seems like it's open source
https://github.com/Ilan12346-maya/XinputBridge

Inputbridge is close source tho

06:22:07
@_discord_195768637427154944:matrix.termux.clubSartek

Yeah, there is also stuff like this that works on the wine side.

https://github.com/nefarius/XInputHooker

06:23:46
@_discord_195768637427154944:matrix.termux.clubSartek *

Yeah, there is also stuff like this that works on the wine side.

https://github.com/nefarius/XInputHooker

06:23:46
@_discord_195768637427154944:matrix.termux.clubSartek

This on windows for getting multiple keyboards and multiple mice to independently work in different games, good for multi seat gaming.

https://nucleus-coop.github.io/docs/protoinput/

There is lots of stuff on the windows side that's used but will make anticheat software unhappy and will only work on wine. On the Linux side I don't think there there is that much out there as people usually have more control and don't need to resort to injecting code and replacing libraries with different implementations.

06:29:06
@_discord_195768637427154944:matrix.termux.clubSartek *

This on windows for getting multiple keyboards and multiple mice to independently work in different games, good for multi seat gaming.

https://nucleus-coop.github.io/docs/protoinput/

There is lots of stuff on the windows side that's used but will make anticheat software unhappy and will only work on wine. On the Linux side I don't think there there is that much out there as people usually have more control and don't need to resort to injecting code and replacing libraries with different implementations.

06:29:07
@_discord_722419788034474004:matrix.termux.clubtwaik

translating controller input to mouse and keyboard can quickly become a mess
I did not say I will implement something this like.
What you most likely have to do is override the normal executables behaviour to attempt to search for controller input devices in the usual place and have it instead access a virtual device in a place that android without root does have the permissions too
Only possible with proot. And I already explained why I do not want to mess with it.
I prefer LD_PRELOAD with hooking libc function as more appropriate.
I believe Android has security that prevents game controller input being sent to an Android application unless it is in focus
You do not need any security mechanisms if you do not send input events to anyone except focused window...
as we are using termux x11 that would then have to send it to the termux process in the background with whatever method is available further complicating it before termux then "emulates" a controller device in what the executable program thinks is /dev/input/js0
It will literally be interacting with unix socket, without any kind of messing with android input model or background/foreground processes.

06:31:27
@_discord_195768637427154944:matrix.termux.clubSartekThank you, you have been very helpful, I don't have any experience with Android development so I wasn't aware that Unix sockets were available, I was under the impression that they were using network traffic through localhost. I'm happy with your proposed solution using LD_PRELOAD. I'll look more into it and do some research. I really appreciate you taking the time to explain the inner workings of how termux does things.06:43:25
@_discord_195768637427154944:matrix.termux.clubSartekSo I did some digging and apparently adb shell has access to /dev/input and with shizuku I can get a adb shell on the local device just by being connected to a wifi network, in the linked Reddit post it is mentioned that apps are prevented from creating named Unix sockets which is probably an issue.07:35:34
@_discord_195768637427154944:matrix.termux.clubSartekhttps://www.reddit.com/r/termux/s/CXhvFQFbJt07:35:53
@_discord_195768637427154944:matrix.termux.clubSartekShizuku has a program called rish that you can run in termux to connect to shizuku. It might be a dead end.07:38:52
@_discord_722419788034474004:matrix.termux.clubtwaikWho said apps are restricted from creating unix sockets?07:42:20
@_discord_195768637427154944:matrix.termux.clubSartekSpecifically named Unix sockets, it's a reddit post so maybe it's not true.07:42:45
@_discord_722419788034474004:matrix.termux.clubtwaikThere is no such restriction...07:43:08
@_discord_722419788034474004:matrix.termux.clubtwaikAnd how exactly shizuku will help forwarding devices? Its ability to execute programs with debug privileges does not magically bring the ability to open device nodes in termux's app sandbox.07:44:59
@_discord_195768637427154944:matrix.termux.clubSartekYeah, so it's likely a dead end cause termux can't run inside an adb shell? I'll have to look into limitations of adb shell.07:48:54
@_discord_722419788034474004:matrix.termux.clubtwaikTermux's programs can not run in adb because adb can not access /data/data/com.termux... Not related to sdk level or unix socket restriction or anything. They will work fine if you build the whole termux environment for, i.e. /data/local/tmp (AFAIK the only place ADB has write access to).07:51:28
@_discord_195768637427154944:matrix.termux.clubSartekOkay so if I did that then in theory I could run a Linux executable and access my game controller. It wouldn't be able to send data to termux-x11 app for graphics as it can only write to /data/local/tmp it can't do any networking or Unix sockets or anything like that?07:57:34
@_discord_722419788034474004:matrix.termux.clubtwaik termux-x11 can run in any android app sandbox since it instantiates X server on the side of your environment. And after this interacts with the main app code via Binder to avoid messing with permissions of Unix sockets. So it is signature/userid agnostic. 08:00:03
@lofi:nexions.netLofii changed their display name from Lofi to Lofii.08:28:07

There are no newer messages yet.


Back to Room ListRoom Version: 6