I'm not sure how, but I knew this was kernel code about halfway through the first function. It's strange, because I've never written any kernel code before. Is there any dead giveaway in the first function that says, "This is code from the kernel"?
The things that stuck out to me were a kmalloc/kfree and a goto/label (which isn't the biggest giveaway, but the only C I've seen that used gotos and wasn't terrible code is the linux kernel, the goto is also used in the same style as they are in the kernel).
Is there any reason this shouldn't work on an iOS device? It's all Javascript. I just can't get my iPad to pop up a keyboard to start triggering keypress events.
This js simply binds an "KeyDown" event listener to the document. There are no actual input fields so an iOS device.. that's why you don't get a keyboard.