The format of the messages should be explained in the manual of your keyboard, that's not something I can tell you.
You compare arrays in your code using std::equal or memcmp, or individual bytes using the == operator. You can find which of the bytes is set using something like
std::find or std::find_if, or a manual for loop if you don't have access to the standard library.