What Is It?
KapcodeMsgSys is a tool built into Macropad that was made for simple scripts written buy programmers to take advantage of Macropad, and allow their programs to be directly connected to macropad. This way developers can allow users to make buttons on their phones that interact with the users computer in new ways, that go beyond Just keyboard shortcuts, or mouse movements.
OK, the short answer is...
A plugin system for macropad
How does it work?
Macropad connects to users phone(s)/tablet(s). The MsgSys allows the messages sent to the computer containing the PROGRAM: tag to be written to a file. Then the plugin a developer would just have to check if the file had any thing in it, and do work when the file does based on what is in it, and what its name is.
Give me an example
You make a program called REYALP CLV , that plays all video and audio, backwards.
Lets also say you have came across the Macropad app, and like it, and would like to allow users to use it, but assigning keyboard shortcuts for all the things you want users to be able to do becomes unreasonable due to the amount of them.
This is when you would use our simple KapcodeMsgSys API to communicate with the users phone, Rather then using a keyListener, or a KeyboardHook to react to users Macropad use.
what LANGUAGES does it support?
Java Coming soon
...Contact me to request any additional langues
Why Rely on Files for COMMUNICATION?
Right now this service only works with reading files, this is of course an issue when speed, and latency are an issue.
I will not be replacing the file method, some programs will only rarely need to communicate, or may not be able to afford a blocking call, or even creating a new thread to handle network reading.
But, I plan on adding TCP, and UDP Socket support into Macropad Server, and the API, allowing for faster communication, when it is needed.
*MsgSys assumes the user has a ram disk, this usually is not the case, but is a temporary fix for speed/latency issues*
Download and place the class files into your project
import them into your class file
using namespace std;
Pass the name of your program to the following method
String msgFilePath =
call the bellow method to get the message if it is avalible.
string msg = KapcodeMsgSys::getMessage(msgFilePath);
do if statements, checking if it is empty first is a good idea.
For this to work, the getPathToModMessageFileOnRamDisk() method is reading a file in your programs running directory called "RAM_DISK_LOCATION.txt". Macropad will create this file when the user goes into KapcodeMsgSys settings in the settings menu. This will bring up a popup.
An important issue to note, the api is assuming there is a file in your program directory called "RAM_DISK_LOCATION.txt" containing the path to the RamDisk, or the folder that the api should find the message file in. If the user has not yet setup the KapcodeMsgSys Setting correctly, the method getPathToModMessageFileOnRamDisk("") will return an empty string
to get around this for now, until I fix this issue, make sure the user knows to setup MsgSys Settings correctly before starting your program,.. or turning on the functionality in your program.
You could also run it in a loop, and check that the ramdisk location has been set before trying to check for a message.
Please check out our blog
Feel free to leave comments and questions about KapcodeMsgSys, you can also Email me Via the Contact US page.