Typically you'd address this by writing/using a Linux device driver that interfaces the hardware to the Linux input events system. The rest would flow naturally from that. There are GPIO keyboard modules in the mainline kernel... Device Drivers -> GPIO Support and Device Drivers -> Input device support -> Keyboards. I don't know if that is useful on your board.

If you must do it in your program. How does your program get notified that a key is pressed and/or released? Is an interrupt generated or are you expected to poll? Essentially the code in my fakeKeyPress() routine is the sort of code you should execute when you hear of a key being pressed. You need to generate appropriate QKeyEvents for the keys pressed.