GIMX doesn't recognise xdotool events

Discuss everything to do with GIMX here
Post Reply
benvan
Posts: 4
Joined: Mon Jul 14, 2014 1:00 pm

GIMX doesn't recognise xdotool events

Post by benvan »

Hi there,

I've built a bot which watches the screen and plays FF9's "100 nobles" minigame. Unfortunately, I can't get the bot to actually send a command through to GIMX...

I'm using xdotool to (try to) simulate keypresses, but GIMX is unaware of xdotool's presence as a virtual keyboard. I suspect this is because x-automation tools do not use /dev/input/eventN nodes. I modified GIMX/event/src/linux/events.c to print the devices it comes across - they're all physical:

Code: Select all

14:17:23 [~/Installs/gimx-src/GIMX/core] ./emuclient --config default2.xml --status --nograb
option -c with value `default2.xml'
grab flag is unset
status flag is set
connected to emu 0
using default refresh period: 11.25ms
/dev/input/event0 Logitech USB Receiver
/dev/input/event1 Logitech USB Receiver
/dev/input/event2 Gaming Keyboard
/dev/input/event3 Gaming Keyboard
/dev/input/event4 G15 Keyboard G15 Keyboard
/dev/input/event5 Power Button
/dev/input/event6 Power Button
/dev/input/event7 PC Speaker
/dev/input/event8 HDA Intel Line Out Side
/dev/input/event9 HDA Intel Line Out CLFE
/dev/input/event10 HDA Intel Line Out Surround
/dev/input/event11 HDA Intel Line Out Front
/dev/input/event12 HDA Intel Line
/dev/input/event13 HDA Intel Front Mic
/dev/input/event14 HDA Intel Rear Mic
/dev/input/event15 HDA ATI HDMI HDMI/DP,pcm=3
xinput --list on the other hand shows the virtual device:

Code: Select all

⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ Logitech USB Receiver                   	id=8	[slave  pointer  (2)]
⎜   ↳ Logitech USB Receiver                   	id=9	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Power Button                            	id=7	[slave  keyboard (3)]
    ↳ Gaming Keyboard                         	id=10	[slave  keyboard (3)]
    ↳ Gaming Keyboard                         	id=11	[slave  keyboard (3)]
    ↳ G15 Keyboard G15 Keyboard               	id=12	[slave  keyboard (3)]
Given that this worked at some point (see http://gimx.fr/forum/viewtopic.php?f=5&t=247 ), I'm wondering if anybody knows either what's changed, or how I can alternatively supply keypresses to GIMX via xte / xdotool or something similar. I should note that I'm not running the release build - it was segfaulting for me, so I found a stable commit in dev. I'm currently on e5dbd10.

Any advice much appreciated, and thanks Matlo for an awesome tool.

Cheers
Ben
benvan
Posts: 4
Joined: Mon Jul 14, 2014 1:00 pm

Re: GIMX doesn't recognise xdotool events

Post by benvan »

On a side note, I noticed that TCP/IP support was added fairly recently. I managed to get dev HEAD compiling (I'm on Arch linux), but the "emu" binary has since disappeared and I cannot work out how I'm supposed to get the new "gimx" binary (the old emuclient) to connect to the ps3. If somebody knows how, I may be able to forgo xev simulation entirely.

Thanks
Ben
benvan
Posts: 4
Joined: Mon Jul 14, 2014 1:00 pm

Re: GIMX doesn't recognise xdotool events

Post by benvan »

[PARTIALLY SOLVED]

Note for future travellers - managed to get this working today by using the network capability of the latest gimx binary.

Issues:
I'm on arch linux
- <bluetooth/mgmt.h> doesn't exist in standard bluez package. I got the header from the bluez git repository and copied it into /usr/include/bluetooth
- <ncurses/ncurses.h> is just <ncurses> for me
- I had to use sudo - there's some file permission required somewhere but I didn't work out what it was. (not /dev/input/event*). GIMX won't start without it
- I had to provide 127.0.0.1 to -s

Usage:
sudo ./gimx --config default.xml --status --nograb -s 127.0.0.1:9615 -b [XX:YY:ZZ:11:22]
.. then in another shell ..
./gimx -d 127.0.0.1:9615 --event "circle(255)" && sleep 0.1 && ./gimx -d 127.0.0.1:9615 --event "circle(0)"

In my case, that last line's in a bash script, i.e. "./key circle"

Didn't manage to get xautomation working and probably won't bother now, but hope this post might be helpful to someone else in the future.
User avatar
Matlo
Posts: 5764
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: GIMX doesn't recognise xdotool events

Post by Matlo »

Gimx doesn't read X input events, it directly reads /dev/input/{event,js}.
xdotool generates X input events, and because of that gimx doesn't get them.

The network support will be documented soon. It actually works over UDP/IP.
GIMX creator
Post Reply