Closed IntinteDAO closed 1 year ago
On Android 4.4 (required Root) the QIII4A engine supported such an option officially, but I don't think it works with newer Androids.
As far as I know we can make libinput
with disabled udev
do that, but it will require adb
/root
client. It is already in TODO list, next to hardware keyboard capturer.
It seems to me that partly similar functionality is present in the XServer XSDL
It is possible to do that without root, but it can possibly break Dex mode. I am not sure if I will do that. But I possibly will find out if it works...
It would be good if we could capture the mouse as in the already created games that support mouse control (Minecraft Bedrock Edition and osu!lazer). Also, if we could send mouse movements directly to the Linux system, we might be able to obliterate mouse acceleration in the Android OS...
@twaik First, thank you for implementing Pointer lock or mouse capture, it seems to capture the mouse while using Samsung Dex.
I noticed that Firefox or Dosbox-x (the only 2 I've tested) dont behave correctly when the mouse is captured. It still behaves as if the mouse is not captured. Are my expectations wrong? Is there something missing that I dont understand or I maybe I dont understand how it works.
I can see the mouse has been captured by the Termux:X11 App (window) > I open Firefox > Go to website to test mouse capture at https://mdn.github.io/dom-examples/pointer-lock/ but I see that the "red ball" in the demo page goes crazy.
Expected result should be: move mouse left> ball goes left, move mouse up> ball goes up. What I see: move mouse>ball goes the distance of "the invisible mouse position" and the center of the screen/window.
It seems that the mouse pointer, upon capturing, it's not kept in the middle of the screen.
termux-x11 receives absolute pointer coordinates even in the case of touchpad mode so it always looks like pointer can not be locked. I'll check what I can do.
is it possible to implement this?
Maybe
Tested briefly in browser and it works. Great thank you.
This is probably impossible, but I prefer to ask myself.
The idea is to capture all mouse events so that, for example, you can play FPS on Termux X11 in the future.
1) On Android 4.4 (required Root) the QIII4A engine supported such an option officially, but I don't think it works with newer Androids.
2) It seems to me that partly similar functionality is present in the XServer XSDL (with me at least) and this can be seen in Motorola Ready Now (it is worth confirming if it works in DeX and globally), when there is a window with information about the connection to the XServer the mouse cursor does not appear and the XServer itself "blocks" the Android mouse. If it's not a bug or anything, maybe it's possible to write Termux X11 in such a way that the cursor in Termux X11 can move, but that Android thinks it's not moving or something similar.