Control kodi using QProcess()

Hi! Do you think it’s possible to send keystrokes via QProcess() to kodi to emulate the keyword? I’m running kodi, Qt5.7 in Raspbian Jessie:

Code:
QProcess *m_kodi = new QProcess(this);
m_kodi->start("kodi");
// ...
m_kodi->write("c"); // should open the Contextual menu
// ...
QByteArray left;
left.append(0x1B);
left.append('[');
left.append('D');
m_kodi->write(left); // should move the current focus to the left