Originally Posted by cyclops0000
so would the waitforkey command or whatever i end up using to shutdown the player, how would i implement it into the kindle? would i ave to repack the videoplayer or something, or would i just need to add a command to execute the script when i launch the videoplayer?
You can use "waitforkey" in a script, but it stalls waiting for input. I ran it (in a script) in the background by appending an "&" (to the script)
and piped waitforkey
output "> /tmp/keypress". It ran in a loop so it would restart after storing a keycode.
The foreground script would read /tmp/keypress with "cat /tmp/keypress" and then after seeing a keypress write a "0 0" for "no keypress" back to the file. It would periodically check that file during its main run loop (which also contained a sleep call and only checked for keypresses about 10 times per second). Yes a hack, but it worked well for my needs. I am sure there is a better way, but sometimes getting a hack working quickly is better than giving up in frustration while trying to figure out "the RIGHT way" to do something.
You can also process keypresses by reading the binary /dev/event* device data for the keyboard (using hexdump from a script, or in a C program).
There are other ways to, but they would require more research.