Page 1 of 1

Would it be possible to set up splitscreen?

Posted: Tue Apr 18, 2017 11:39
by WinkingBaby
Does anyone know of a program that can focus on two windows at once? The reason I ask is because when trying to set up two clients at once the game will only focus on one window at a time, and I'd like to be able to focus on two to do a sort of split screen. If there isn't that would be a neat feature to implement. That and controller support.

Re: Would it be possible to set up splitscreen?

Posted: Tue Apr 18, 2017 12:43
by Nyarg
2 PC + 'microsoft garage mouse without borders' with mode 'All computers' )

Re: Would it be possible to set up splitscreen?

Posted: Tue Apr 18, 2017 13:17
by WinkingBaby
It's not really splitscreen if it requires 2 pcs.

Re: Would it be possible to set up splitscreen?

Posted: Tue Apr 18, 2017 13:21
by Nyarg
As I know Windows OS technology allow only one window have focus at a time.

Re: Would it be possible to set up splitscreen?

Posted: Tue Apr 18, 2017 13:39
by Linuxdirk
For Linux you can use X input lists. It will give you two mouse cursors (or in general the way to use multiple input devices at once each having their own representation in X). But no-one wants to mess with that :)

Maybe set up an VM and bind one set of input devices to the VM and unbind it from the host system?

Re: Would it be possible to set up splitscreen?

Posted: Wed Apr 19, 2017 04:51
by WinkingBaby
Yeah, might have to go with a virtual machine. Let's hope that doesn't harm performance too much.

Re: Would it be possible to set up splitscreen?

Posted: Sat Apr 29, 2017 20:14
by TG-MyinaWD
There is actually a way you can play Minecraft PC same time but separate inputs and outputs. Mostly just need a Gamepad to function properly.

Re: Would it be possible to set up splitscreen?

Posted: Mon Aug 19, 2019 15:26
by mijutu
Running two minetests simultanously works quite well on X11, but Irrlicht (or the window manager) needs to choose one pointer to work with for each of the minetest instances.

Attached is a minimal patch to Irrlicht that makes it possible to choose a pointer with an environment variable.

On Debian/Ubuntu you can use it like this (file names from Debian buster)
  • sudo apt build-dep libirrlicht-dev
  • mkdir -p ~/src/irrlicht && cd ~/src/irrlicht
  • apt source libirrlicht-dev
  • zcat irrlicht_mpx.diff.gz | patch -p0
  • cd irrlicht-1.8.4+dfsg1
  • dpkg-buildpackage -b
  • sudo dpkg -i ../libirrlicht1.8_1.8.4+dfsg1-1.1_amd64.deb
Connect another keyboard and another mouse. Then create a second pointer and reattach one mouse and one keyboard to it, for example.
  • xinput create-master second
  • xinput list
  • xinput reattach "Name of a mouse" "second pointer"
  • xinput reattach "Name of a keyboard" "second keyboard"
Now you can run two minetests at once. Replace the numbers 2 and 16 with master pointer ids from output of xinput list
  • POINTER=2 minetest &
  • POINTER=16 minetest &

Re: Would it be possible to set up splitscreen?

Posted: Mon Aug 19, 2019 21:41
by Festus1965
interesting, as what is faster ...
change the hands to the other set of Keyboard/mouse - or esc screen and move to other,
as on my 3 monitor system I often manages other gamer on 2nd monitor to setup their mess on my own
and yes, so also I could let 2nd mtc stand to be able to watch an area like spawn point beside, like webcam

Re: Would it be possible to set up splitscreen?

Posted: Thu Aug 22, 2019 18:42
by mijutu
I didn't try this, but I think you can use triggerhappy to set up a hotkey to reattach your keboard and mouse to another master pointer. This way you could switch between minetest instances with one keypress.

Another thing I didn't try yet: Set up split screen with multiple gamepads:
  • Run antimicro in uinput mode to generate as many virtual keyboards and mice as there are gamepads (are multiple antimicro instances needed for this?)
  • create master pointers with xinput
  • reattach the virtual keboards and mice to master pointers
  • run multiple minetest instances

Re: Would it be possible to set up splitscreen?

Posted: Sat Aug 24, 2019 06:09
by Chiantos
Deleted message

Re: Would it be possible to set up splitscreen?

Posted: Tue Jun 07, 2022 20:32
by mijutu
I wrote a new mpx patch for current version of irrlicht.
  • Follow instructions for compiling minetest from source: Download minetest and irrlicht sources.
  • cd lib/irrlichtmt
  • zcat /tmp/irrlicht-mpx-1.9.0mt5.diff.gz |git apply -
  • Compile (and install if needed)
  • Do xinput setup and start minetest with POINTER environment variable same way as in the 2019 instructions

Re: Would it be possible to set up splitscreen?

Posted: Tue Jun 07, 2022 21:20
by Linuxdirk
Unlikely it will be added, but have you tried to create a pull request on Minetest’s Irrlicht fork?

Re: Would it be possible to set up splitscreen?

Posted: Mon Sep 05, 2022 20:13
by mijutu
I found a much easier way to do this: patch xwit instead of minetest.

I offered the patch to Debian: https://bugs.debian.org/cgi-bin/bugrepo ... ug=1019214

New instructions:

Patch and install xwit:
  • sudo apt build-dep xwit
  • apt source xwit
  • cd xwit-*
  • curl 'https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=1019214;filename=xwit-mpx.patch;msg=5'|patch -p1
  • dpkg-buildpackage -b
  • sudo dpkg -i ../xwit_*.deb
Connect another keyboard and another mouse. Then create a second pointer and reattach one mouse and one keyboard to it, for example
  • xinput create-master second
  • xinput list
  • xinput reattach "Name of a mouse" "second pointer"
  • xinput reattach "Name of a keyboard" "second keyboard"
Run two minetests simultaneously:
  • minetest & minetest &
  • xwit -pointer $(xinput --list --id-only 'Virtual core pointer') -id $(xwininfo |awk '/^xwininfo: Window id:/{print $4}') -xisetpointer
  • Click the minetest window where you want to use your primary mouse and keyboard
  • xwit -pointer $(xinput --list --id-only 'second pointer') -id $(xwininfo |awk '/^xwininfo: Window id:/{print $4}') -xisetpointer
  • Click the minetest window where you want to use your secondary mouse and keyboard