Page 1 of 1
How to play macros?
Posted: Mon Sep 08, 2014 1:17 am
by andre
Hi! I need support with playing the test macro.
How do I play the macro? When I press the F1 button on my keyboard the macro doesn't play.
I've got this two files in the folder /home/user/.gimx/macros/
macros.txt
test.txt
Code: Select all
#Defines the action that triggers the macro execution
MACRO F1
#Performs a keystroke (key down + delay 50ms + key up)
KEY e
#Sleep 50ms
DELAY 50
#Perform a key down
KEYDOWN SPACE
#Sleep 50ms (minimum delay between KEYDOWN and KEYUP)
DELAY 50
#Perform a key up
KEYUP SPACE
I already replaced MACRO F1 with my L1 button MACRO JBUTTONDOWN 14
without success.
I'm starting gimx via terminal
gimx --config config.xml --hci 0 --bdaddr XX:XX:XX:XX:XX:XX --status
Here is my config config.xml:
http://pastebin.com/jBb3ZcfJ
Thank you!
Re: How to play macros?
Posted: Mon Sep 08, 2014 9:50 am
by Matlo
Hi,
The keys used in the macro do not match any control mapping in your config, which means that even if the macro is started, there will be no resulting action.
Re: How to play macros?
Posted: Mon Sep 08, 2014 11:33 am
by andre
I edited my config:
http://pastebin.com/kSmeg66q
And here is my new macro:
Code: Select all
#start with l1 button.
#Already tested with MACRO KEYDOWN p. But didn't react.
MACRO JBUTTONDOWN 10
#go left
JBUTTON 7
DELAY 50
JBUTTON 7
DELAY 50
JBUTTON 7
DELAY 50
JBUTTON 7
DELAY 50
#go up
JBUTTON 6
DELAY 50
JBUTTON 6
DELAY 50
#and down again
JBUTTON 4
DELAY 50
JBUTTON 4
DELAY 50
JBUTTON 4
DELAY 50
When I click L1 the macro does not start.
With MACRO KEYDOWN p there is also no reaction by pressing the p on my keyboard.
Here my console log after pressing L1 several times.
Code: Select all
gimx --config config.xml --hci 0 --bdaddr XX:XX:XX:XX:XX:XX --status
option -c with value `config.xml'
option -h with value `0'
option -b with value `XX:XX:XX:XX:XX:XX'
status flag is set
connecting with hci0 = YY:YY:YY:YY:YY:YY to XX:XX:XX:XX:XX:XX psm 0x0011
using default refresh period: 10.00ms
A device name is empty. Multiple mice and keyboards are not managed.
connecting with hci0 = YY:YY:YY:YY:YY:YY to XX:XX:XX:XX:XX:XX psm 0x0013
0 1410175102.584848
0 1410175103.451085, l1 (255)
0 1410175103.742311
0 1410175103.967537, l1 (255)
0 1410175104.124885
0 1410175104.271794, l1 (255)
0 1410175104.463552
0 1410175104.574786, l1 (255)
0 1410175104.766133
0 1410175104.856568, l1 (255)
0 1410175105.468895
0 1410175105.622082, l1 (255)
0 1410175105.767523
0 1410175105.891150, l1 (255)
0 1410175106.014190
0 1410175106.094833, l1 (255)
0 1410175106.228307
0 1410175106.295828, l1 (255)
0 1410175106.386282
Exiting
Thanks!
Re: How to play macros?
Posted: Mon Sep 08, 2014 11:56 am
by Matlo
I tried with your config (I changed the joystick name as I don't have the same joystick) and with your macro, and it works for me:
Code: Select all
0 1410177235.863255, l1 (255)
0 1410177235.873294, left (255), l1 (255)
0 1410177235.923251, l1 (255)
0 1410177235.973250, left (255), l1 (255)
0 1410177236.023250, l1 (255)
0 1410177236.033276
0 1410177236.073248, left (255)
0 1410177236.123251
0 1410177236.173264, left (255)
0 1410177236.223254
Which GIMX version are you using?
Re: How to play macros?
Posted: Mon Sep 08, 2014 12:08 pm
by andre
The about dialog displays gimx-config 3.0 x86_64.
Now I updated to 3.1. No change.
Re: How to play macros?
Posted: Mon Sep 08, 2014 1:05 pm
by andre
My OS:
Linux Mint 17 Qiana
VERSION="14.04, Trusty Tahr"
the adapter:
Hama Nano-Bluetooth-USB-Adapter Version 2.1.
Cambridge Silicon Radio (10)
Chip: BlueCore4-Rom
the console: PS3 slim
PS3 SHENGHIC 2009 fake ps3 controller
Re: How to play macros?
Posted: Mon Sep 08, 2014 11:39 pm
by andre
Hi Matlo!
I thought to debug GIMX in eclipse till it loads the macros.txt in /home/user/.gimx/macros/ and reads the line with my macro file. Perhaps the path is wrong or something is with my syntax.
I followed the
Development_on_Linux guide but also need to install wxwidgets under Linux Mint with this guides
http://wiki.wxwidgets.org/Installing_an ... der_Ubuntu
http://wiki.wxwidgets.org/Eclipse
So all the unresolved wx/... inclusion errors went away in eclipse.
Now I try to build GIMX in eclipse by clicking "Build Project" but got this missing GE.h error.
make all
Building file: ../shared/event/test/GE_test.c
Invoking: GCC C Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 `wx-config --cflags` -MMD -MP -MF"shared/event/test/GE_test.d" -MT"shared/event/test/GE_test.d" -o "shared/event/test/GE_test.o" "../shared/event/test/GE_test.c"
In file included from ../shared/event/test/GE_test.c:15:0:
../shared/event/test/common.h:11:16: fatal error: GE.h: File or dir not found
#include <GE.h>
^
compilation terminated.
make: *** [shared/event/test/GE_test.o] Error 1
I excluded this path. And got the next error with missing controller2.h.
Do you have a correct run configuration? So I can run with the debugger through the code of macros.c.
Perhaps you wanna update the
Development_on_Linux guide for newbies

!?
Re: How to play macros?
Posted: Tue Sep 09, 2014 7:28 am
by Matlo
Hi,
I think your build issue is due to a wrong project setting. Eclipse is probably trying to build GIMX using a generated makefile, which is wrong.
It's not really easy to debug gimx in eclipse because it needs root permissions...
What you can do instead is:
- edit the Makedefs file: comment/uncomment the CFLAGS/CXXFLAGS lines
- run "make clean ; make -j" as a normal user
- run "sudo su" to switch to the root user
- run "cd core"
- run "gdb gimx"
- type "b read_macros"
- type "r --config config.xml --hci 0 --bdaddr XX:XX:XX:XX:XX:XX --status" and press enter
- gimx should run until it reaches the read_macros function
then you can:
- execute the program line by line typing "n"
- step into a function typing "s"
- finish a function execution typing "f"
- print a variable typing "p <variable name>"
- ...